From 05119ecaf6e8628377f324da97ff6af58f3e380f Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 7 Mar 2009 08:51:40 +0000 Subject: [PATCH 01/89] Make data related to suboption parsing const in libvo git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28863 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_aa.c | 8 ++++---- libvo/vo_directfb2.c | 2 +- libvo/vo_gif89a.c | 2 +- libvo/vo_gl.c | 2 +- libvo/vo_gl2.c | 2 +- libvo/vo_ivtv.c | 2 +- libvo/vo_jpeg.c | 2 +- libvo/vo_md5sum.c | 2 +- libvo/vo_png.c | 2 +- libvo/vo_pnm.c | 2 +- libvo/vo_sdl.c | 2 +- libvo/vo_v4l2.c | 2 +- libvo/vo_vdpau.c | 2 +- libvo/vo_xv.c | 2 +- libvo/vo_xvmc.c | 2 +- libvo/vo_yuv4mpeg.c | 2 +- libvo/vo_zr2.c | 2 +- 17 files changed, 20 insertions(+), 20 deletions(-) diff --git a/libvo/vo_aa.c b/libvo/vo_aa.c index 5046a8b9ec..d4b596b40a 100644 --- a/libvo/vo_aa.c +++ b/libvo/vo_aa.c @@ -578,19 +578,19 @@ static int parse_suboptions(const char *arg) { char *pseudoargv[4], *osdcolor = NULL, *subcolor = NULL, **strings, *helpmsg = NULL; int pseudoargc, displayhelp = 0, *booleans; - opt_t extra_opts[] = { + const opt_t extra_opts[] = { {"osdcolor", OPT_ARG_MSTRZ, &osdcolor, NULL, 0}, {"subcolor", OPT_ARG_MSTRZ, &subcolor, NULL, 0}, {"help", OPT_ARG_BOOL, &displayhelp, NULL, 0} }; opt_t *subopts = NULL, *p; - char *strings_list[] = {"-driver", "-kbddriver", "-mousedriver", "-font", + char * const strings_list[] = {"-driver", "-kbddriver", "-mousedriver", "-font", "-width", "-height", "-minwidth", "-minheight", "-maxwidth", "-maxheight", "-recwidth", "-recheight", "-bright", "-contrast", "-gamma", "-dimmul", "-boldmul", "-random" }; - char *booleans_list[] = {"-dim", "-bold", "-reverse", "-normal", + char * const booleans_list[] = {"-dim", "-bold", "-reverse", "-normal", "-boldfont", "-inverse", "-extended", "-eight", "-dither", "-floyd_steinberg", "-error_distribution"}; - char *nobooleans_list[] = {"-nodim", "-nobold", "-noreverse", "-nonormal", + char * const nobooleans_list[] = {"-nodim", "-nobold", "-noreverse", "-nonormal", "-noboldfont", "-noinverse", "-noextended", "-noeight", "-nodither", "-nofloyd_steinberg", "-noerror_distribution"}; const int nstrings = sizeof(strings_list) / sizeof(char*); diff --git a/libvo/vo_directfb2.c b/libvo/vo_directfb2.c index 133f46a07e..7aafe091e9 100644 --- a/libvo/vo_directfb2.c +++ b/libvo/vo_directfb2.c @@ -175,7 +175,7 @@ static int preinit(const char *arg) strarg_t mode_str = {0, NULL}; strarg_t par_str = {0, NULL}; strarg_t dfb_params = {0, NULL}; - opt_t subopts[] = { + const opt_t subopts[] = { {"input", OPT_ARG_BOOL, &use_input, NULL}, {"buffermode", OPT_ARG_STR, &mode_str, check_mode}, {"fieldparity", OPT_ARG_STR, &par_str, check_parity}, diff --git a/libvo/vo_gif89a.c b/libvo/vo_gif89a.c index b7a9894591..3ad230a20b 100644 --- a/libvo/vo_gif89a.c +++ b/libvo/vo_gif89a.c @@ -104,7 +104,7 @@ static char *gif_filename = NULL; // the default output filename #define DEFAULT_FILE "out.gif" -static opt_t subopts[] = { +static const opt_t subopts[] = { {"output", OPT_ARG_MSTRZ, &gif_filename, NULL, 0}, {"fps", OPT_ARG_FLOAT, &target_fps, NULL, 0}, {NULL, 0, NULL, NULL, 0} diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index b39a3c077d..e1db6622bf 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -973,7 +973,7 @@ uninit(void) vo_uninit(); } -static opt_t subopts[] = { +static const opt_t subopts[] = { {"manyfmts", OPT_ARG_BOOL, &many_fmts, NULL}, {"osd", OPT_ARG_BOOL, &use_osd, NULL}, {"scaled-osd", OPT_ARG_BOOL, &scaled_osd, NULL}, diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 28afc77829..9509001165 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -844,7 +844,7 @@ uninit(void) vo_uninit(); } -static opt_t subopts[] = { +static const opt_t subopts[] = { {"yuv", OPT_ARG_INT, &use_yuv, (opt_test_f)int_non_neg}, {"glfinish", OPT_ARG_BOOL, &use_glFinish, NULL}, {NULL} diff --git a/libvo/vo_ivtv.c b/libvo/vo_ivtv.c index 05f37303d5..7dd9279f38 100644 --- a/libvo/vo_ivtv.c +++ b/libvo/vo_ivtv.c @@ -59,7 +59,7 @@ static vo_mpegpes_t *pes; static int output = -1; static char *device = NULL; -static opt_t subopts[] = { +static const opt_t subopts[] = { {"output", OPT_ARG_INT, &output, (opt_test_f)int_non_neg}, {"device", OPT_ARG_MSTRZ, &device, NULL}, {NULL} diff --git a/libvo/vo_jpeg.c b/libvo/vo_jpeg.c index e1a397eaf1..bcd86c6eec 100644 --- a/libvo/vo_jpeg.c +++ b/libvo/vo_jpeg.c @@ -339,7 +339,7 @@ static int int_zero_hundred(int *val) static int preinit(const char *arg) { - opt_t subopts[] = { + const opt_t subopts[] = { {"progressive", OPT_ARG_BOOL, &jpeg_progressive_mode, NULL, 0}, {"baseline", OPT_ARG_BOOL, &jpeg_baseline, NULL, 0}, {"optimize", OPT_ARG_INT, &jpeg_optimize, diff --git a/libvo/vo_md5sum.c b/libvo/vo_md5sum.c index 4fd9cdd618..08dc49d548 100644 --- a/libvo/vo_md5sum.c +++ b/libvo/vo_md5sum.c @@ -107,7 +107,7 @@ static void md5sum_write_error(void) { static int preinit(const char *arg) { - opt_t subopts[] = { + const opt_t subopts[] = { {"outfile", OPT_ARG_MSTRZ, &md5sum_outfile, NULL, 0}, {NULL, 0, NULL, NULL, 0} }; diff --git a/libvo/vo_png.c b/libvo/vo_png.c index 5a2edf7ed9..b2e75897ea 100644 --- a/libvo/vo_png.c +++ b/libvo/vo_png.c @@ -290,7 +290,7 @@ static int int_zero_to_nine(int *sh) return 1; } -static opt_t subopts[] = { +static const opt_t subopts[] = { {"alpha", OPT_ARG_BOOL, &use_alpha, NULL, 0}, {"z", OPT_ARG_INT, &z_compression, (opt_test_f)int_zero_to_nine}, {"outdir", OPT_ARG_MSTRZ, &png_outdir, NULL, 0}, diff --git a/libvo/vo_pnm.c b/libvo/vo_pnm.c index ba88db29e9..6525a2141d 100644 --- a/libvo/vo_pnm.c +++ b/libvo/vo_pnm.c @@ -120,7 +120,7 @@ static int preinit(const char *arg) { int ppm_type = 0, pgm_type = 0, pgmyuv_type = 0, raw_mode = 0, ascii_mode = 0; - opt_t subopts[] = { + const opt_t subopts[] = { {"ppm", OPT_ARG_BOOL, &ppm_type, NULL, 0}, {"pgm", OPT_ARG_BOOL, &pgm_type, NULL, 0}, {"pgmyuv", OPT_ARG_BOOL, &pgmyuv_type, NULL, 0}, diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c index 26b17776fd..8ec6d4fbc3 100644 --- a/libvo/vo_sdl.c +++ b/libvo/vo_sdl.c @@ -1526,7 +1526,7 @@ static int preinit(const char *arg) char * sdl_driver = NULL; int sdl_hwaccel; int sdl_forcexv; - opt_t subopts[] = { + const opt_t subopts[] = { {"forcexv", OPT_ARG_BOOL, &sdl_forcexv, NULL, 0}, {"hwaccel", OPT_ARG_BOOL, &sdl_hwaccel, NULL, 0}, {"driver", OPT_ARG_MSTRZ, &sdl_driver, NULL, 0}, diff --git a/libvo/vo_v4l2.c b/libvo/vo_v4l2.c index 7cecfd75da..1f611d864a 100644 --- a/libvo/vo_v4l2.c +++ b/libvo/vo_v4l2.c @@ -53,7 +53,7 @@ static vo_mpegpes_t *pes; static int output = -1; static char *device = NULL; -static opt_t subopts[] = { +static const opt_t subopts[] = { {"output", OPT_ARG_INT, &output, (opt_test_f)int_non_neg}, {"device", OPT_ARG_MSTRZ, &device, NULL}, {NULL} diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c index 28ae555e71..4e0194493e 100644 --- a/libvo/vo_vdpau.c +++ b/libvo/vo_vdpau.c @@ -949,7 +949,7 @@ static void uninit(void) dlclose(vdpau_lib_handle); } -static opt_t subopts[] = { +static const opt_t subopts[] = { {"deint", OPT_ARG_INT, &deint, (opt_test_f)int_non_neg}, {"pullup", OPT_ARG_BOOL, &pullup, NULL}, {"denoise", OPT_ARG_FLOAT, &denoise, NULL}, diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index 47174d41a0..7ae0d48ac1 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -611,7 +611,7 @@ static int preinit(const char *arg) strarg_t ck_method_arg = { 0, NULL }; int xv_adaptor = -1; - opt_t subopts[] = + const opt_t subopts[] = { /* name arg type arg var test */ { "port", OPT_ARG_INT, &xv_port, (opt_test_f)int_pos }, diff --git a/libvo/vo_xvmc.c b/libvo/vo_xvmc.c index 1492bcedcf..5d14cf83e5 100644 --- a/libvo/vo_xvmc.c +++ b/libvo/vo_xvmc.c @@ -379,7 +379,7 @@ static int preinit(const char *arg){ int mc_ver,mc_rev; strarg_t ck_src_arg = { 0, NULL }; strarg_t ck_method_arg = { 0, NULL }; - opt_t subopts [] = + const opt_t subopts [] = { /* name arg type arg var test */ { "port", OPT_ARG_INT, &xv_port_request, (opt_test_f)int_pos }, diff --git a/libvo/vo_yuv4mpeg.c b/libvo/vo_yuv4mpeg.c index 3b7c06c782..a7790fcc52 100644 --- a/libvo/vo_yuv4mpeg.c +++ b/libvo/vo_yuv4mpeg.c @@ -513,7 +513,7 @@ static void check_events(void) static int preinit(const char *arg) { int il, il_bf; - opt_t subopts[] = { + const opt_t subopts[] = { {"interlaced", OPT_ARG_BOOL, &il, NULL}, {"interlaced_bf", OPT_ARG_BOOL, &il_bf, NULL}, {"file", OPT_ARG_MSTRZ, &yuv_filename, NULL}, diff --git a/libvo/vo_zr2.c b/libvo/vo_zr2.c index fb1fa025e6..34a92c4172 100644 --- a/libvo/vo_zr2.c +++ b/libvo/vo_zr2.c @@ -209,7 +209,7 @@ static int preinit(const char *arg) { const char *dev = NULL; char *dev_arg = NULL, *norm_arg = NULL; int norm = VIDEO_MODE_AUTO, prebuf = 0; - opt_t subopts[] = { /* don't want warnings with -Wall... */ + const opt_t subopts[] = { /* don't want warnings with -Wall... */ { "dev", OPT_ARG_MSTRZ, &dev_arg, NULL, 0 }, { "prebuf", OPT_ARG_BOOL, &prebuf, (opt_test_f)pbc, 0 }, { "norm", OPT_ARG_MSTRZ, &norm_arg, (opt_test_f)nc, 0 }, From fca78186689deea70cb619a5e0bc3dc5dd74651e Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 7 Mar 2009 08:52:57 +0000 Subject: [PATCH 02/89] Setting vo_fs is handled by x11_common.c, so remove that code from vo_xv/vo_xvmc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28864 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_xv.c | 2 -- libvo/vo_xvmc.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index 7ae0d48ac1..d9325eb9a9 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -295,8 +295,6 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, current_buf = 0; current_ip_buf = 0; - if ((flags & VOFLAG_FULLSCREEN) && WinID <= 0) vo_fs = 1; - resize(); return 0; diff --git a/libvo/vo_xvmc.c b/libvo/vo_xvmc.c index 5d14cf83e5..38b3a80b14 100644 --- a/libvo/vo_xvmc.c +++ b/libvo/vo_xvmc.c @@ -664,8 +664,6 @@ skip_surface_allocation: #endif } - if ((flags & VOFLAG_FULLSCREEN) && WinID <= 0) vo_fs = 1; - //end vo_xv /* store image dimesions for displaying */ From 2ee2d164ce2c06fb17f6d47446003a717e25e63c Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 7 Mar 2009 09:08:02 +0000 Subject: [PATCH 03/89] Make several constant mp3lib tables const git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28865 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mp3lib/decode_mmx.c | 10 +++++----- mp3lib/layer3.c | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mp3lib/decode_mmx.c b/mp3lib/decode_mmx.c index 55dc6a9081..67a7cdb510 100644 --- a/mp3lib/decode_mmx.c +++ b/mp3lib/decode_mmx.c @@ -12,9 +12,9 @@ #define real float /* ugly - but only way */ extern void (*dct64_MMX_func)(short*, short*, real*); -static unsigned long long attribute_used __attribute__((aligned(8))) null_one = 0x0000ffff0000ffffULL; -static unsigned long long attribute_used __attribute__((aligned(8))) one_null = 0xffff0000ffff0000ULL; -unsigned int __attribute__((aligned(16))) costab_mmx[] = +static const unsigned long long attribute_used __attribute__((aligned(8))) null_one = 0x0000ffff0000ffffULL; +static const unsigned long long attribute_used __attribute__((aligned(8))) one_null = 0xffff0000ffff0000ULL; +const unsigned int __attribute__((aligned(16))) costab_mmx[] = { 1056974725, 1057056395, @@ -54,7 +54,7 @@ unsigned int __attribute__((aligned(16))) costab_mmx[] = make_decode_tables_MMX(32768), which had been implemented in (deleted since r23383) tabinit_MMX.c. */ -static short __attribute__((aligned(8))) mp3lib_decwins[] = +static const short __attribute__((aligned(8))) mp3lib_decwins[] = { 0, 7, 54, 114, 510, 1288, 1644, 9372, 18760, -9373, 1644, -1289, 510, -115, 54, -8, @@ -191,7 +191,7 @@ int synth_1to1_MMX(real *bandPtr, int channel, short *samples) static short buffs[2][2][0x110] __attribute__((aligned(8))); static int bo = 1; short *b0, (*buf)[0x110], *a, *b; - short* window; + const short* window; int bo1, i = 8; if (channel == 0) { diff --git a/mp3lib/layer3.c b/mp3lib/layer3.c index 3511c70f3a..eeb331eb85 100644 --- a/mp3lib/layer3.c +++ b/mp3lib/layer3.c @@ -53,7 +53,7 @@ struct bandInfoStruct { static int longLimit[9][23]; static int shortLimit[9][14]; -static struct bandInfoStruct bandInfo[9] = { +static const struct bandInfoStruct bandInfo[9] = { /* MPEG 1.0 */ { {0,4,8,12,16,20,24,30,36,44,52,62,74, 90,110,134,162,196,238,288,342,418,576}, @@ -132,7 +132,7 @@ static void init_layer3(int down_sample_sblimit) for (i=0;i<8;i++) { - static double Ci[8]={-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037}; + static const double Ci[8]={-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037}; double sq=sqrt(1.0+Ci[i]*Ci[i]); aa_cs[i] = 1.0/sq; aa_ca[i] = Ci[i]/sq; @@ -180,7 +180,7 @@ static void init_layer3(int down_sample_sblimit) } for(j=0;j<4;j++) { - static int len[4] = { 36,36,12,36 }; + static const int len[4] = { 36,36,12,36 }; for(i=0;ilongDiff; @@ -984,7 +984,7 @@ static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT],int *scalefac, struct gr_info_s *gr_info,int sfreq,int ms_stereo,int lsf) { real (*xr)[SBLIMIT*SSLIMIT] = (real (*)[SBLIMIT*SSLIMIT] ) xr_buf; - struct bandInfoStruct *bi = &bandInfo[sfreq]; + const struct bandInfoStruct *bi = &bandInfo[sfreq]; const real *tab1,*tab2; From 69277f986b26dcbae99903eb76e859efb57409ec Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 7 Mar 2009 09:14:45 +0000 Subject: [PATCH 04/89] Reduce size of needlessly large mp3lib bandInfoStruct git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28866 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mp3lib/layer3.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mp3lib/layer3.c b/mp3lib/layer3.c index eeb331eb85..71dec48663 100644 --- a/mp3lib/layer3.c +++ b/mp3lib/layer3.c @@ -44,10 +44,10 @@ static real cos9[3],cos18[3]; #endif struct bandInfoStruct { - int longIdx[23]; - int longDiff[22]; - int shortIdx[14]; - int shortDiff[13]; + uint16_t longIdx[23]; + uint8_t longDiff[22]; + uint16_t shortIdx[14]; + uint8_t shortDiff[13]; }; static int longLimit[9][23]; @@ -216,7 +216,7 @@ static void init_layer3(int down_sample_sblimit) const struct bandInfoStruct *bi = &bandInfo[j]; int *mp; int cb,lwin; - const int *bdf; + const uint8_t *bdf; mp = map[j][0] = mapbuf0[j]; bdf = bi->longDiff; From b099db94af947c2ac9e6888fddeac9b6e6e0fe6d Mon Sep 17 00:00:00 2001 From: sdrik Date: Sat, 7 Mar 2009 09:37:25 +0000 Subject: [PATCH 05/89] YUVA420P is a planar YUV format git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28867 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index cdf3754d14..13b9609060 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -228,6 +228,7 @@ const char *sws_format_name(int format); #define isPlanarYUV(x) ( \ (x)==PIX_FMT_YUV410P \ || (x)==PIX_FMT_YUV420P \ + || (x)==PIX_FMT_YUVA420P \ || (x)==PIX_FMT_YUV411P \ || (x)==PIX_FMT_YUV422P \ || (x)==PIX_FMT_YUV444P \ From 052223b1958cfe0ce39a2180dfccb6a76af61ed9 Mon Sep 17 00:00:00 2001 From: sdrik Date: Sat, 7 Mar 2009 09:39:48 +0000 Subject: [PATCH 06/89] Let the 4th plane reach the swScale function git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28868 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index c0f4b97684..1307a5076b 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2726,7 +2726,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]){ int i; - uint8_t* src2[4]= {src[0], src[1], src[2]}; + uint8_t* src2[4]= {src[0], src[1], src[2], src[3]}; if (c->sliceDir == 0 && srcSliceY != 0 && srcSliceY + srcSliceH != c->srcH) { av_log(c, AV_LOG_ERROR, "Slices start in the middle!\n"); @@ -2800,21 +2800,23 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, // copy strides, so they can safely be modified if (c->sliceDir == 1) { // slices go from top to bottom - int srcStride2[4]= {srcStride[0], srcStride[1], srcStride[2]}; - int dstStride2[4]= {dstStride[0], dstStride[1], dstStride[2]}; + int srcStride2[4]= {srcStride[0], srcStride[1], srcStride[2], srcStride[3]}; + int dstStride2[4]= {dstStride[0], dstStride[1], dstStride[2], dstStride[3]}; return c->swScale(c, src2, srcStride2, srcSliceY, srcSliceH, dst, dstStride2); } else { // slices go from bottom to top => we flip the image internally uint8_t* dst2[4]= {dst[0] + (c->dstH-1)*dstStride[0], dst[1] + ((c->dstH>>c->chrDstVSubSample)-1)*dstStride[1], - dst[2] + ((c->dstH>>c->chrDstVSubSample)-1)*dstStride[2]}; - int srcStride2[4]= {-srcStride[0], -srcStride[1], -srcStride[2]}; - int dstStride2[4]= {-dstStride[0], -dstStride[1], -dstStride[2]}; + dst[2] + ((c->dstH>>c->chrDstVSubSample)-1)*dstStride[2], + dst[3] + (c->dstH-1)*dstStride[3]}; + int srcStride2[4]= {-srcStride[0], -srcStride[1], -srcStride[2], -srcStride[3]}; + int dstStride2[4]= {-dstStride[0], -dstStride[1], -dstStride[2], -dstStride[3]}; src2[0] += (srcSliceH-1)*srcStride[0]; if (!usePal(c->srcFormat)) src2[1] += ((srcSliceH>>c->chrSrcVSubSample)-1)*srcStride[1]; src2[2] += ((srcSliceH>>c->chrSrcVSubSample)-1)*srcStride[2]; + src2[3] += (srcSliceH-1)*srcStride[3]; return c->swScale(c, src2, srcStride2, c->srcH-srcSliceY-srcSliceH, srcSliceH, dst2, dstStride2); } From 7397dbcb66b7e2e36120c3c7e5d05f81962a1d2c Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 7 Mar 2009 12:50:52 +0000 Subject: [PATCH 07/89] Update x264 version check for version required by lavc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28869 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index a0d9013547..4596a804f0 100755 --- a/configure +++ b/configure @@ -7042,7 +7042,7 @@ if test "$_x264" = auto ; then cat > $TMPC << EOF #include #include -#if X264_BUILD < 59 +#if X264_BUILD < 65 #error We do not support old versions of x264. Get the latest from SVN. #endif int main(void) { x264_encoder_open((void*)0); return 0; } From 062f66bbcaa4ae449aec5068f0fc67d0ced04654 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 7 Mar 2009 13:25:55 +0000 Subject: [PATCH 08/89] Make pausing_keep_force the default for the set_mouse_pos and key_down_event - different behaviour is unlikely to make sense but it is better to handle this in input.c instead of adding special cases to mplayer.c and being able to override the default behaviour at least should not hurt. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28870 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/tech/slave.txt | 2 ++ input/input.c | 11 ++++++++++- mplayer.c | 3 +-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/DOCS/tech/slave.txt b/DOCS/tech/slave.txt index 2ad276defd..df23826c3c 100644 --- a/DOCS/tech/slave.txt +++ b/DOCS/tech/slave.txt @@ -30,6 +30,8 @@ As a temporary hack, there is also the _experimental_ "pausing_keep_force " prefix, with which MPlayer will not exit the pause loop at all. Like this you can avoid the "frame stepping" effect of "pausing_keep " but most commands will either not work at all or behave in unexpected ways. +For "set_mouse_pos" and "key_down_event", "pausing_keep_force" is the default +since other values do not make much sense for them. Available commands ('mplayer -input cmdlist' will print a list): diff --git a/input/input.c b/input/input.c index dcbeb2b11d..a12dd27958 100644 --- a/input/input.c +++ b/input/input.c @@ -767,7 +767,7 @@ int mp_input_parse_and_queue_cmds(const char *str) { mp_cmd_t* mp_input_parse_cmd(char* str) { int i,l; - int pausing = 0; + int pausing = -1; char *ptr,*e; mp_cmd_t *cmd; const mp_cmd_t *cmd_def; @@ -817,6 +817,15 @@ mp_input_parse_cmd(char* str) { cmd = calloc(1, sizeof(mp_cmd_t)); cmd->id = cmd_def->id; cmd->name = strdup(cmd_def->name); + if (pausing == -1) { + switch (cmd->id) { + case MP_CMD_KEYDOWN_EVENTS: + case MP_CMD_SET_MOUSE_POS: + pausing = 4; break; + default: + pausing = 0; break; + } + } cmd->pausing = pausing; ptr = str; diff --git a/mplayer.c b/mplayer.c index 1b6a35025b..81fc389ae0 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2346,8 +2346,7 @@ static void pause_loop(void) if (mpctx->audio_out && mpctx->sh_audio) mpctx->audio_out->pause(); // pause audio, keep data if possible - while ( (cmd = mp_input_get_cmd(20, 1, 1)) == NULL - || cmd->id == MP_CMD_SET_MOUSE_POS || cmd->pausing == 4) { + while ( (cmd = mp_input_get_cmd(20, 1, 1)) == NULL || cmd->pausing == 4) { if (cmd) { cmd = mp_input_get_cmd(0,1,0); run_command(mpctx, cmd); From 1e94c915a2a6949b641c0650cd56d1dc7478dd3d Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 7 Mar 2009 13:45:48 +0000 Subject: [PATCH 09/89] cosmetics: Reformat file header. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28871 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_macosx.m | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m index 1cd1d43b76..040ae19097 100644 --- a/libvo/vo_macosx.m +++ b/libvo/vo_macosx.m @@ -1,4 +1,7 @@ /* + * Mac OS X video output driver + * Copyright (c) 2005 Nicolas Plourde + * * This file is part of MPlayer. * * MPlayer is free software; you can redistribute it and/or modify @@ -16,14 +19,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* - vo_macosx.m - by Nicolas Plourde - - MPlayer Mac OSX video out module. - Copyright (c) Nicolas Plourde - 2005 -*/ - #import "vo_macosx.h" #include #include From 41bd5a75fd9611b79f4fae56743021d36df6e89f Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 7 Mar 2009 17:41:34 +0000 Subject: [PATCH 10/89] cosmetics: spelling fixes git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28872 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_macosx.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m index 040ae19097..8a238191c7 100644 --- a/libvo/vo_macosx.m +++ b/libvo/vo_macosx.m @@ -95,7 +95,7 @@ static BOOL isLeopardOrLater; static vo_info_t info = { - "Mac OSX Core Video", + "Mac OS X Core Video", "macosx", "Nicolas Plourde ", "" @@ -127,7 +127,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ } else { - mp_msg(MSGT_VO, MSGL_FATAL, "Get device error: Device ID %d do not exist, falling back to main device.\n", screen_id); + mp_msg(MSGT_VO, MSGL_FATAL, "Get device error: Device ID %d does not exist, falling back to main device.\n", screen_id); screen_handle = [screen_array objectAtIndex:0]; screen_id = -1; } @@ -212,7 +212,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ return 1; } - //connnect to mplayerosx + //connect to mplayerosx mplayerosxProxy=[NSConnection rootProxyForConnectionWithRegisteredName:[NSString stringWithCString:buffer_name] host:nil]; if ([mplayerosxProxy conformsToProtocol:@protocol(MPlayerOSXVOProto)]) { [mplayerosxProxy setProtocolForProxy:@protocol(MPlayerOSXVOProto)]; @@ -357,7 +357,7 @@ static int preinit(const char *arg) "Example: mplayer -vo macosx:device_id=1:shared_buffer:buffer_name=mybuff\n" "\nOptions:\n" " device_id=<0-...>\n" - " Set screen device id for fullscreen.\n" + " Set screen device ID for fullscreen.\n" " shared_buffer\n" " Write output to a shared memory buffer instead of displaying it.\n" " buffer_name=\n" @@ -808,7 +808,7 @@ static int control(uint32_t request, void *data, ...) curTime = TickCount()/60; - //auto hide mouse cursor (and future on-screen control?) + //automatically hide mouse cursor (and future on-screen control?) if(isFullscreen && !mouseHide && !isRootwin) { if( ((curTime - lastMouseHide) >= 5) || (lastMouseHide == 0) ) @@ -959,8 +959,8 @@ static int control(uint32_t request, void *data, ...) return; [NSApp sendEvent:event]; // Without SDL's bootstrap code (include SDL.h in mplayer.c), - // on Leopard, we got trouble to get the play window auto focused - // when app is actived. Following code fix this problem. + // on Leopard, we have trouble to get the play window automatically focused + // when the app is actived. The Following code fix this problem. #ifndef CONFIG_SDL if (isLeopardOrLater && [event type] == NSAppKitDefined && [event subtype] == NSApplicationActivatedEventType) { From 463d61c7a620dd7593072ff4c46fff558998357e Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 7 Mar 2009 23:56:03 +0000 Subject: [PATCH 11/89] Only use first \org in a line. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28873 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 7263413963..d3347b6bbf 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1059,10 +1059,12 @@ static char* parse_tag(char* p, double pwr) { skip(')'); mp_msg(MSGT_ASS, MSGL_DBG2, "org(%d, %d)\n", v1, v2); // render_context.evt_type = EVENT_POSITIONED; - render_context.org_x = v1; - render_context.org_y = v2; - render_context.have_origin = 1; - render_context.detect_collisions = 0; + if (!render_context.have_origin) { + render_context.org_x = v1; + render_context.org_y = v2; + render_context.have_origin = 1; + render_context.detect_collisions = 0; + } } else if (mystrcmp(&p, "t")) { double v[3]; int v1, v2; From 668810ab04cb3adffa187dcb5075841837a62af6 Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 8 Mar 2009 02:53:14 +0000 Subject: [PATCH 12/89] Replace rotation functions with a simplified version adapted from vsfilter. This (mostly) fixes http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1394#c7 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28874 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 119 +++++++++++++++----------------------------- 1 file changed, 40 insertions(+), 79 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index d3347b6bbf..19cb89a4ec 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1796,75 +1796,46 @@ static void get_base_point(FT_BBox bbox, int alignment, int* bx, int* by) } /** - * \brief Multiply 4-vector by 4-matrix - * \param a 4-vector - * \param m 4-matrix] - * \param b out: 4-vector - * Calculates a * m and stores result in b + * \brief Apply transformation to outline points of a glyph + * Applies rotations given by frx, fry and frz and projects the points back + * onto the screen plane. */ -static inline void transform_point_3d(double *a, double *m, double *b) -{ - b[0] = a[0] * m[0] + a[1] * m[4] + a[2] * m[8] + a[3] * m[12]; - b[1] = a[0] * m[1] + a[1] * m[5] + a[2] * m[9] + a[3] * m[13]; - b[2] = a[0] * m[2] + a[1] * m[6] + a[2] * m[10] + a[3] * m[14]; - b[3] = a[0] * m[3] + a[1] * m[7] + a[2] * m[11] + a[3] * m[15]; -} - -/** - * \brief Apply 3d transformation to a vector - * \param v FreeType vector (2d) - * \param m 4-matrix - * Transforms v by m, projects the result back to the screen plane - * Result is returned in v. - */ -static inline void transform_vector_3d(FT_Vector* v, double *m) { - const double camera = 2500 * frame_context.border_scale; // camera distance - const double cutoff_z = 10.; - double a[4], b[4]; - a[0] = d6_to_double(v->x); - a[1] = d6_to_double(v->y); - a[2] = 0.; - a[3] = 1.; - transform_point_3d(a, m, b); - /* Apply perspective projection with the following matrix: - 2500 0 0 0 - 0 2500 0 0 - 0 0 0 0 - 0 0 8 2500 - where 2500 is camera distance, 8 - z-axis scale. - Camera is always located in (org_x, org_y, -2500). This means - that different subtitle events can be displayed at the same time - using different cameras. */ - b[0] *= camera; - b[1] *= camera; - b[3] = 8 * b[2] + camera; - if (b[3] < cutoff_z) - b[3] = cutoff_z; - v->x = double_to_d6(b[0] / b[3]); - v->y = double_to_d6(b[1] / b[3]); -} - -/** - * \brief Apply 3d transformation to a glyph - * \param glyph FreeType glyph - * \param m 4-matrix - * Transforms glyph by m, projects the result back to the screen plane - * Result is returned in glyph. - */ -static inline void transform_glyph_3d(FT_Glyph glyph, double *m, FT_Vector shift) { - int i; - FT_Outline* outline = &((FT_OutlineGlyph)glyph)->outline; +static void transform_3d_points(FT_Vector shift, FT_Glyph glyph, double frx, double fry, double frz) { + double sx = sin(frx); + double sy = sin(fry); + double sz = sin(frz); + double cx = cos(frx); + double cy = cos(fry); + double cz = cos(frz); + FT_Outline *outline = &((FT_OutlineGlyph) glyph)->outline; FT_Vector* p = outline->points; + double x, y, z, xx, yy, zz; + int i; for (i=0; in_points; i++) { - p[i].x += shift.x; - p[i].y += shift.y; - transform_vector_3d(p + i, m); - p[i].x -= shift.x; - p[i].y -= shift.y; - } + x = p[i].x + shift.x; + y = p[i].y + shift.y; + z = 0.; - //transform_vector_3d(&glyph->advance, m); + xx = x*cz + y*sz; + yy = -(x*sz - y*cz); + zz = z; + + x = xx; + y = yy*cx + zz*sx; + z = yy*sx - zz*cx; + + xx = x*cy + z*sy; + yy = y; + zz = x*sy - z*cy; + + zz = FFMAX(zz, -19000); + + x = (xx * 20000) / (zz + 20000); + y = (yy * 20000) / (zz + 20000); + p[i].x = x - shift.x + 0.5; + p[i].y = y - shift.y + 0.5; + } } /** @@ -1879,28 +1850,18 @@ static inline void transform_glyph_3d(FT_Glyph glyph, double *m, FT_Vector shift */ static void transform_3d(FT_Vector shift, FT_Glyph* glyph, FT_Glyph* glyph2, double frx, double fry, double frz) { - fry = - fry; // FreeType's y axis goes in the opposite direction + frx = - frx; + frz = - frz; if (frx != 0. || fry != 0. || frz != 0.) { - double m[16]; - double sx = sin(frx); - double sy = sin(fry); - double sz = sin(frz); - double cx = cos(frx); - double cy = cos(fry); - double cz = cos(frz); - m[0] = cy * cz; m[1] = cy*sz; m[2] = -sy; m[3] = 0.0; - m[4] = -cx*sz + sx*sy*cz; m[5] = cx*cz + sx*sy*sz; m[6] = sx*cy; m[7] = 0.0; - m[8] = sx*sz + cx*sy*cz; m[9] = -sx*cz + cx*sy*sz; m[10] = cx*cy; m[11] = 0.0; - m[12] = 0.0; m[13] = 0.0; m[14] = 0.0; m[15] = 1.0; - if (glyph && *glyph) - transform_glyph_3d(*glyph, m, shift); + transform_3d_points(shift, *glyph, frx, fry, frz); if (glyph2 && *glyph2) - transform_glyph_3d(*glyph2, m, shift); + transform_3d_points(shift, *glyph2, frx, fry, frz); } } + /** * \brief Main ass rendering function, glues everything together * \param event event to render From eb3f82bfee6b3a95f47ea0557a4002b8b3f4fdac Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 8 Mar 2009 04:03:24 +0000 Subject: [PATCH 13/89] Add a proper color check to the overlap compositing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28875 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libass/ass_render.c b/libass/ass_render.c index 19cb89a4ec..368ee19c7b 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -434,6 +434,9 @@ static void render_overlap(ass_image_t** last_tail, ass_image_t** tail, bitmap_h if ((*last_tail)->bitmap == (*tail)->bitmap) return; + if ((*last_tail)->color != (*tail)->color) + return; + // Calculate overlap coordinates left = (ax > bx) ? ax : bx; top = (ay > by) ? ay : by; From 2c55cbabf9e682ce10535cbc6125cdcc2093dc35 Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 8 Mar 2009 04:03:28 +0000 Subject: [PATCH 14/89] Fix clipping for pan-and-scan. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28876 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 368ee19c7b..c5824322a3 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -2108,11 +2108,11 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) } // fix clip coordinates (they depend on alignment) - render_context.clip_x0 = x2scr(render_context.clip_x0); - render_context.clip_x1 = x2scr(render_context.clip_x1); if (render_context.evt_type == EVENT_NORMAL || render_context.evt_type == EVENT_HSCROLL || render_context.evt_type == EVENT_VSCROLL) { + render_context.clip_x0 = x2scr(render_context.clip_x0); + render_context.clip_x1 = x2scr(render_context.clip_x1); if (valign == VALIGN_TOP) { render_context.clip_y0 = y2scr_top(render_context.clip_y0); render_context.clip_y1 = y2scr_top(render_context.clip_y1); @@ -2124,8 +2124,10 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) render_context.clip_y1 = y2scr_sub(render_context.clip_y1); } } else if (render_context.evt_type == EVENT_POSITIONED) { - render_context.clip_y0 = y2scr(render_context.clip_y0); - render_context.clip_y1 = y2scr(render_context.clip_y1); + render_context.clip_x0 = x2scr_pos(render_context.clip_x0); + render_context.clip_x1 = x2scr_pos(render_context.clip_x1); + render_context.clip_y0 = y2scr_pos(render_context.clip_y0); + render_context.clip_y1 = y2scr_pos(render_context.clip_y1); } // calculate rotation parameters From e46d74d4aebe66706988cbdae79d938f9beb6928 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 08:56:28 +0000 Subject: [PATCH 15/89] Bump etc/codecs.conf version to eliminate one possible cause when debugging VDPAU issues. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28877 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/codecs.conf b/etc/codecs.conf index 11d0a01e18..f9dcf8fc76 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -3,7 +3,7 @@ ; Before editing this file, please read DOCS/tech/codecs.conf.txt ! ;============================================================================= -release 20070930 +release 20090308 ;============================================================================= ; VIDEO CODECS From 4a5c933303a85cce089ee46ef93f2b9e176e12f7 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 09:14:30 +0000 Subject: [PATCH 16/89] Add an option to disable the default key binding that MPlayer includes git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28878 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 2 ++ input/input.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 1004295cc9..b8717dd43b 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -960,6 +960,8 @@ Device to be used for Apple IR Remote (default is autodetected, Linux only). Delay in milliseconds before we start to autorepeat a key (0 to disable). .IPs ar-rate Number of key presses to generate per second on autorepeat. +.IPs (no)default-binds +Use the key bindings that MPlayer ships with by default. .IPs keylist Prints all keys that can be bound to commands. .IPs cmdlist diff --git a/input/input.c b/input/input.c index a12dd27958..6d73be1b3e 100644 --- a/input/input.c +++ b/input/input.c @@ -583,6 +583,7 @@ static mp_cmd_t* ar_cmd = NULL; static unsigned int ar_delay = 100, ar_rate = 8, last_ar = 0; static int use_joystick = 1, use_lirc = 1, use_lircc = 1; +static int default_binds = 1; static char* config_file = "input.conf"; /* Apple Remote */ @@ -611,6 +612,8 @@ static m_option_t input_conf[] = { { "cmdlist", mp_input_print_cmd_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL }, { "js-dev", &js_dev, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL }, { "file", &in_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL }, + { "default-binds", &default_binds, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL }, + { "nodefault-binds", &default_binds, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL }, { NULL, NULL, 0, 0, 0, 0, NULL} }; @@ -1078,7 +1081,7 @@ mp_input_get_cmd_from_keys(int n,int* keys, int paused) { cmd = mp_input_find_bind_for_key(cmd_binds,n,keys); if(cmd_binds_default && cmd == NULL) cmd = mp_input_find_bind_for_key(cmd_binds_default,n,keys); - if(cmd == NULL) + if(default_binds && cmd == NULL) cmd = mp_input_find_bind_for_key(def_cmd_binds,n,keys); if(cmd == NULL) { From 29c8d702423fe063da66ee217669f56c045ded06 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 09:28:01 +0000 Subject: [PATCH 17/89] Remove unused variable from demux_mov. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28879 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_mov.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c index 8217c47a95..bcb249b732 100644 --- a/libmpdemux/demux_mov.c +++ b/libmpdemux/demux_mov.c @@ -2192,7 +2192,6 @@ if(trak->pos==0 && trak->stream_header_len>0){ if (samplenr < 0) vo_sub = NULL; else if (samplenr != priv->current_sub) { - av_unused sh_sub_t *sh = demuxer->sub->sh; off_t pos = trak->samples[samplenr].pos; int len = trak->samples[samplenr].size; double subpts = (double)trak->samples[samplenr].pts / (double)trak->timescale; From 911ae6d594802d615c49b1061b62ee1ee11c5d6f Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 09:34:26 +0000 Subject: [PATCH 18/89] Explain that disabling other input methods is not the purpose of -slave git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28880 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index b8717dd43b..dcb4214859 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -1133,6 +1133,8 @@ by a newline (\\n) from stdin. .I NOTE: See \-input cmdlist for a list of slave commands and DOCS/tech/slave.txt for their description. +Also, this is not intended to disable other inputs, e.g. via the video window, +use some other method like \-input nodefault\-binds:conf=/dev/null for that. . .TP .B \-softsleep From c1359e3dbdbaaf636df6fd5039347e5aed2e91a6 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 10:01:21 +0000 Subject: [PATCH 19/89] Add a small howto explaining how to cross-compile for MinGW git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28881 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/tech/mingw-crosscompile.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 DOCS/tech/mingw-crosscompile.txt diff --git a/DOCS/tech/mingw-crosscompile.txt b/DOCS/tech/mingw-crosscompile.txt new file mode 100644 index 0000000000..55beda7b9a --- /dev/null +++ b/DOCS/tech/mingw-crosscompile.txt @@ -0,0 +1,31 @@ +Due to a lack of Windows developers, it is a good idea to allow Linux +developers to do at least some basic check of their code. +This HOWTO explains how to set up MinGW cross-compilation under Debian. + +First, you need to install the "mingw32" package and get a MPlayer SVN checkou. + +Next, you need quite a lot of dependencies. Since this is for testing and +not actually use, the easiest way is to use this package: +http://natsuki.mplayerhq.hu/~reimar/mpl_mingw32.tar.bz2 +NOTE that this is likely to be quite out-dated and might include packages +with security issues, so do not use it to build binaries for real use. + +After extracting this package into the MPlayer source-tree, +you only need to run the included linux-mingw.sh to configure (it just runs +./configure --host-cc=cc --target=i686-mingw32msvc --cc=i586-mingw32msvc-cc +--windres=i586-mingw32msvc-windres --ranlib=i586-mingw32msvc-ranlib +--with-extraincdir="$PWD/osdep/mingw32" +--with-extralibdir="$PWD/osdep/mingw32" +--with-freetype-config="$PWD/osdep/mingw32/ftconf") and then run make. + +You should be able to run the generated binary with Wine, if you want to. + +The steps as command-lines: + +sudo apt-get install mingw32 +svn co svn://svn.mplayerhq.hu/mplayer/trunk MPlayer-mingw +cd MPlayer-mingw +wget http://natsuki.mplayerhq.hu/~reimar/mpl_mingw32.tar.bz2 +tar -xjf mpl_mingw32.tar.bz2 +sh linux-mingw.sh +make From 8afafb8c2eb88da719b7737ddbc3db1564133a4d Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 12:57:53 +0000 Subject: [PATCH 20/89] Remove useless "extern" in function declarations. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28882 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/native/rtjpegn.h | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/libmpcodecs/native/rtjpegn.h b/libmpcodecs/native/rtjpegn.h index a854818e2f..4cb20c586d 100644 --- a/libmpcodecs/native/rtjpegn.h +++ b/libmpcodecs/native/rtjpegn.h @@ -35,27 +35,27 @@ #define __s32 int32_t #define __s64 int64_t -extern void RTjpeg_init_Q(__u8 Q); -extern void RTjpeg_init_compress(__u32 *buf, int width, int height, __u8 Q); -extern void RTjpeg_init_decompress(__u32 *buf, int width, int height); -extern int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp); -extern int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp); -extern void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp); -extern void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp); -extern int RTjpeg_compress8(__s8 *sp, unsigned char *bp); -extern void RTjpeg_decompress8(__s8 *sp, __u8 *bp); +void RTjpeg_init_Q(__u8 Q); +void RTjpeg_init_compress(__u32 *buf, int width, int height, __u8 Q); +void RTjpeg_init_decompress(__u32 *buf, int width, int height); +int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp); +int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp); +void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp); +void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp); +int RTjpeg_compress8(__s8 *sp, unsigned char *bp); +void RTjpeg_decompress8(__s8 *sp, __u8 *bp); -extern void RTjpeg_init_mcompress(void); -extern int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask); -extern int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask); -extern int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask); -extern void RTjpeg_set_test(int i); +void RTjpeg_init_mcompress(void); +int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask); +int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask); +int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask); +void RTjpeg_set_test(int i); -extern void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb, int stride); -extern void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb, int stride); -extern void RTjpeg_yuvrgb8(__u8 *buf, __u8 *rgb, int stride); -extern void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb, int stride); -extern void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb, int stride); -extern void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb, int stride); +void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb, int stride); +void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb, int stride); +void RTjpeg_yuvrgb8(__u8 *buf, __u8 *rgb, int stride); +void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb, int stride); +void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb, int stride); +void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb, int stride); #endif /* MPLAYER_RTJPEGN_H */ From 04702afb8426d81f69da542f89fdec7ae84550ec Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 13:02:44 +0000 Subject: [PATCH 21/89] Remove functions not used by MPlayer from header git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28883 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/native/rtjpegn.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/libmpcodecs/native/rtjpegn.h b/libmpcodecs/native/rtjpegn.h index 4cb20c586d..4ffcdfa39d 100644 --- a/libmpcodecs/native/rtjpegn.h +++ b/libmpcodecs/native/rtjpegn.h @@ -35,27 +35,12 @@ #define __s32 int32_t #define __s64 int64_t -void RTjpeg_init_Q(__u8 Q); void RTjpeg_init_compress(__u32 *buf, int width, int height, __u8 Q); void RTjpeg_init_decompress(__u32 *buf, int width, int height); int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp); -int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp); void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp); -void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp); -int RTjpeg_compress8(__s8 *sp, unsigned char *bp); -void RTjpeg_decompress8(__s8 *sp, __u8 *bp); void RTjpeg_init_mcompress(void); int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask); -int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask); -int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask); -void RTjpeg_set_test(int i); - -void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb, int stride); -void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb, int stride); -void RTjpeg_yuvrgb8(__u8 *buf, __u8 *rgb, int stride); -void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb, int stride); -void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb, int stride); -void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb, int stride); #endif /* MPLAYER_RTJPEGN_H */ From 6d367acbdde9f542c011b7bfd61689e103e56561 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 13:08:22 +0000 Subject: [PATCH 22/89] Mark everything not used outside the file as "static" git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28884 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/native/rtjpegn.c | 72 ++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/libmpcodecs/native/rtjpegn.c b/libmpcodecs/native/rtjpegn.c index 538bff609a..bf11a3b75f 100644 --- a/libmpcodecs/native/rtjpegn.c +++ b/libmpcodecs/native/rtjpegn.c @@ -68,7 +68,7 @@ static const __u64 RTjpeg_aan_tab[64]={ #if !HAVE_MMX static __s32 RTjpeg_ws[64+31]; #endif -__u8 RTjpeg_alldata[2*64+4*64+4*64+4*64+4*64+32]; +static __u8 RTjpeg_alldata[2*64+4*64+4*64+4*64+4*64+32]; static __s16 *block; // rh static __s16 *RTjpeg_block; @@ -86,13 +86,13 @@ static int RTjpeg_Ysize, RTjpeg_Csize; static __s16 *RTjpeg_old=NULL; #if HAVE_MMX -mmx_t RTjpeg_lmask; -mmx_t RTjpeg_cmask; +static mmx_t RTjpeg_lmask; +static mmx_t RTjpeg_cmask; #else -__u16 RTjpeg_lmask; -__u16 RTjpeg_cmask; +static __u16 RTjpeg_lmask; +static __u16 RTjpeg_cmask; #endif -int RTjpeg_mtest=0; +static int RTjpeg_mtest=0; static const unsigned char RTjpeg_lum_quant_tbl[64] = { 16, 11, 10, 16, 24, 40, 51, 61, @@ -133,7 +133,7 @@ static const unsigned char RTjpeg_chrom_quant_tbl[64] = { /* Block to Stream (encoding) */ /* */ -int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) +static int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) { register int ci, co=1; register __s16 ZZvalue; @@ -303,7 +303,7 @@ fprintf(stdout, "\n\n"); /* Stream to Block (decoding) */ /* */ -int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) +static int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) { int ci; register int co; @@ -447,7 +447,7 @@ fprintf(stdout, "\n\n"); #else -int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) +static int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) { register int ci, co=1, tmp; register __s16 ZZvalue; @@ -506,7 +506,7 @@ int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) return (int)co; } -int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) +static int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) { int ci=1, co=1, tmp; register int i; @@ -539,7 +539,7 @@ int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) #endif #if HAVE_MMX -void RTjpeg_quant_init(void) +static void RTjpeg_quant_init(void) { int i; __s16 *qtbl; @@ -554,7 +554,7 @@ void RTjpeg_quant_init(void) static mmx_t RTjpeg_ones={0x0001000100010001LL}; static mmx_t RTjpeg_half={0x7fff7fff7fff7fffLL}; -void RTjpeg_quant(__s16 *block, __s32 *qtbl) +static void RTjpeg_quant(__s16 *block, __s32 *qtbl) { int i; mmx_t *bl, *ql; @@ -591,11 +591,11 @@ void RTjpeg_quant(__s16 *block, __s32 *qtbl) } } #else -void RTjpeg_quant_init(void) +static void RTjpeg_quant_init(void) { } -void RTjpeg_quant(__s16 *block, __s32 *qtbl) +static void RTjpeg_quant(__s16 *block, __s32 *qtbl) { int i; @@ -626,7 +626,7 @@ static mmx_t RTjpeg_zero ={0x0000000000000000LL}; #define D_MULTIPLY(var,const) ((__s32) ((var) * (const))) #endif -void RTjpeg_dct_init(void) +static void RTjpeg_dct_init(void) { int i; @@ -637,7 +637,7 @@ void RTjpeg_dct_init(void) } } -void RTjpeg_dctY(__u8 *idata, __s16 *odata, int rskip) +static void RTjpeg_dctY(__u8 *idata, __s16 *odata, int rskip) { #if !HAVE_MMX __s32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; @@ -1554,7 +1554,7 @@ void RTjpeg_dctY(__u8 *idata, __s16 *odata, int rskip) #define RL(x) ((x)>235) ? 235 : (((x)<16) ? 16 : (x)) #define MULTIPLY(var,const) (((__s32) ((var) * (const)) + 128)>>8) -void RTjpeg_idct_init(void) +static void RTjpeg_idct_init(void) { int i; @@ -1565,7 +1565,7 @@ void RTjpeg_idct_init(void) } } -void RTjpeg_idct(__u8 *odata, __s16 *data, int rskip) +static void RTjpeg_idct(__u8 *odata, __s16 *data, int rskip) { #if HAVE_MMX @@ -2702,7 +2702,7 @@ Initialise all the cache-aliged data blocks */ -void RTjpeg_init_data(void) +static void RTjpeg_init_data(void) { unsigned long dptr; @@ -2733,7 +2733,7 @@ Input: buf -> pointer to 128 ints for quant values store to pass back to Q -> quality factor (192=best, 32=worst) */ -void RTjpeg_init_Q(__u8 Q) +static void RTjpeg_init_Q(__u8 Q) { int i; __u64 qual; @@ -2907,7 +2907,7 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) return (sp-sb); } -int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp) +static int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp) { __s8 * sb; register __s8 * bp2 = bp + RTjpeg_Ysize; @@ -2951,7 +2951,7 @@ int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp) return (sp-sb); } -int RTjpeg_compress8(__s8 *sp, unsigned char *bp) +static int RTjpeg_compress8(__s8 *sp, unsigned char *bp) { __s8 * sb; int i, j; @@ -2979,7 +2979,7 @@ int RTjpeg_compress8(__s8 *sp, unsigned char *bp) return (sp-sb); } -void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp) +static void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp) { register __s8 * bp2 = bp + RTjpeg_Ysize; register __s8 * bp3 = bp2 + (RTjpeg_Csize); @@ -3089,7 +3089,7 @@ void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp) #endif } -void RTjpeg_decompress8(__s8 *sp, __u8 *bp) +static void RTjpeg_decompress8(__s8 *sp, __u8 *bp) { int i, j; @@ -3140,7 +3140,7 @@ void RTjpeg_init_mcompress(void) #if HAVE_MMX -int RTjpeg_bcomp(__s16 *old, mmx_t *mask) +static int RTjpeg_bcomp(__s16 *old, mmx_t *mask) { int i; mmx_t *mold=(mmx_t *)old; @@ -3186,7 +3186,7 @@ int RTjpeg_bcomp(__s16 *old, mmx_t *mask) } #else -int RTjpeg_bcomp(__s16 *old, __u16 *mask) +static int RTjpeg_bcomp(__s16 *old, __u16 *mask) { int i; @@ -3201,7 +3201,7 @@ int RTjpeg_bcomp(__s16 *old, __u16 *mask) } #endif -void RTjpeg_set_test(int i) +static void RTjpeg_set_test(int i) { RTjpeg_mtest=i; } @@ -3298,7 +3298,7 @@ int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask } -int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask) +static int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask) { __s8 * sb; __s16 *block; @@ -3374,7 +3374,7 @@ int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask return (sp-sb); } -int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask) +static int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask) { __s8 * sb; __s16 *block; @@ -3412,7 +3412,7 @@ int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask) return (sp-sb); } -void RTjpeg_color_init(void) +static void RTjpeg_color_init(void) { } @@ -3422,7 +3422,7 @@ void RTjpeg_color_init(void) #define KcbB 132252 #define Ky 76284 -void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb, int stride) +static void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb, int stride) { int tmp; int i, j; @@ -3470,7 +3470,7 @@ void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb, int stride) } -void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb, int stride) +static void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb, int stride) { int tmp; int i, j; @@ -3544,7 +3544,7 @@ void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb, int stride) } -void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb, int stride) +static void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb, int stride) { int tmp; int i, j; @@ -3620,7 +3620,7 @@ void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb, int stride) } } -void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb, int stride) +static void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb, int stride) { int tmp; int i, j; @@ -3693,7 +3693,7 @@ void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb, int stride) } } -void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb, int stride) +static void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb, int stride) { int tmp; int i, j; @@ -3790,7 +3790,7 @@ void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb, int stride) /* fix stride */ -void RTjpeg_yuvrgb8(__u8 *buf, __u8 *rgb, int stride) +static void RTjpeg_yuvrgb8(__u8 *buf, __u8 *rgb, int stride) { memcpy(rgb, buf, RTjpeg_width*RTjpeg_height); } From 735c81a0f5a030be77e411ac49be23bb090a793a Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 13:10:21 +0000 Subject: [PATCH 23/89] Remove colourspace-conversion stuff from rtjpeg, we have functions to do that better and it doesn't belong in that file anyway. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28885 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/native/rtjpegn.c | 384 ----------------------------------- 1 file changed, 384 deletions(-) diff --git a/libmpcodecs/native/rtjpegn.c b/libmpcodecs/native/rtjpegn.c index bf11a3b75f..662b117e40 100644 --- a/libmpcodecs/native/rtjpegn.c +++ b/libmpcodecs/native/rtjpegn.c @@ -3411,387 +3411,3 @@ static int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask) #endif return (sp-sb); } - -static void RTjpeg_color_init(void) -{ -} - -#define KcrR 76284 -#define KcrG 53281 -#define KcbG 25625 -#define KcbB 132252 -#define Ky 76284 - -static void RTjpeg_yuv422rgb(__u8 *buf, __u8 *rgb, int stride) -{ - int tmp; - int i, j; - __s32 y, crR, crG, cbG, cbB; - __u8 *bufcr, *bufcb, *bufy, *bufoute; - int yskip; - - yskip=RTjpeg_width; - - bufcb=&buf[RTjpeg_width*RTjpeg_height]; - bufcr=&buf[RTjpeg_width*RTjpeg_height+(RTjpeg_width*RTjpeg_height)/2]; - bufy=&buf[0]; - bufoute=rgb; - - for(i=0; i<(RTjpeg_height); i++) - { - for(j=0; j>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+cbB)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - - y=(bufy[j+1]-16)*Ky; - - tmp=(y+crR)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+cbB)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - - } - bufy+=yskip; - } -} - - -static void RTjpeg_yuv420rgb(__u8 *buf, __u8 *rgb, int stride) -{ - int tmp; - int i, j; - __s32 y, crR, crG, cbG, cbB; - __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto; - int oskip, yskip; - - if(stride==0) - oskip=RTjpeg_width*3; - else - oskip=2*stride-RTjpeg_width*3; - - yskip=RTjpeg_width; - - bufcb=&buf[RTjpeg_width*RTjpeg_height]; - bufcr=&buf[RTjpeg_width*RTjpeg_height+(RTjpeg_width*RTjpeg_height)/4]; - bufy=&buf[0]; - bufoute=rgb; - bufouto=rgb+RTjpeg_width*3; - - for(i=0; i<(RTjpeg_height>>1); i++) - { - for(j=0; j>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+cbB)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - - y=(bufy[j+1]-16)*Ky; - - tmp=(y+crR)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+cbB)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - - y=(bufy[j+yskip]-16)*Ky; - - tmp=(y+crR)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+cbB)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - - y=(bufy[j+1+yskip]-16)*Ky; - - tmp=(y+crR)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+cbB)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - - } - bufoute+=oskip; - bufouto+=oskip; - bufy+=yskip<<1; - } -} - - -static void RTjpeg_yuvrgb32(__u8 *buf, __u8 *rgb, int stride) -{ - int tmp; - int i, j; - __s32 y, crR, crG, cbG, cbB; - __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto; - int oskip, yskip; - - if(stride==0) - oskip=RTjpeg_width*4; - else - oskip = 2*stride-RTjpeg_width*4; - yskip=RTjpeg_width; - - bufcb=&buf[RTjpeg_width*RTjpeg_height]; - bufcr=&buf[RTjpeg_width*RTjpeg_height+(RTjpeg_width*RTjpeg_height)/2]; - bufy=&buf[0]; - bufoute=rgb; - bufouto=rgb+RTjpeg_width*4; - - for(i=0; i<(RTjpeg_height>>1); i++) - { - for(j=0; j>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - bufoute++; - - y=(bufy[j+1]-16)*Ky; - - tmp=(y+cbB)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - bufoute++; - - y=(bufy[j+yskip]-16)*Ky; - - tmp=(y+cbB)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - bufouto++; - - y=(bufy[j+1+yskip]-16)*Ky; - - tmp=(y+cbB)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - bufouto++; - - } - bufoute+=oskip; - bufouto+=oskip; - bufy+=yskip<<1; - } -} - -static void RTjpeg_yuvrgb24(__u8 *buf, __u8 *rgb, int stride) -{ - int tmp; - int i, j; - __s32 y, crR, crG, cbG, cbB; - __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto; - int oskip, yskip; - - if(stride==0) - oskip=RTjpeg_width*3; - else - oskip=2*stride - RTjpeg_width*3; - - yskip=RTjpeg_width; - - bufcb=&buf[RTjpeg_width*RTjpeg_height]; - bufcr=&buf[RTjpeg_width*RTjpeg_height+(RTjpeg_width*RTjpeg_height)/4]; - bufy=&buf[0]; - bufoute=rgb; - bufouto=rgb+RTjpeg_width*3; - - for(i=0; i<(RTjpeg_height>>1); i++) - { - for(j=0; j>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - - y=(bufy[j+1]-16)*Ky; - - tmp=(y+cbB)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - *(bufoute++)=(tmp>255)?255:((tmp<0)?0:tmp); - - y=(bufy[j+yskip]-16)*Ky; - - tmp=(y+cbB)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - - y=(bufy[j+1+yskip]-16)*Ky; - - tmp=(y+cbB)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - *(bufouto++)=(tmp>255)?255:((tmp<0)?0:tmp); - - } - bufoute+=oskip; - bufouto+=oskip; - bufy+=yskip<<1; - } -} - -static void RTjpeg_yuvrgb16(__u8 *buf, __u8 *rgb, int stride) -{ - int tmp; - int i, j; - __s32 y, crR, crG, cbG, cbB; - __u8 *bufcr, *bufcb, *bufy, *bufoute, *bufouto; - int oskip, yskip; - unsigned char r, g, b; - - if(stride==0) - oskip=RTjpeg_width*2; - else - oskip=2*stride-RTjpeg_width*2; - - yskip=RTjpeg_width; - - bufcb=&buf[RTjpeg_width*RTjpeg_height]; - bufcr=&buf[RTjpeg_width*RTjpeg_height+(RTjpeg_width*RTjpeg_height)/4]; - bufy=&buf[0]; - bufoute=rgb; - bufouto=rgb+RTjpeg_width*2; - - for(i=0; i<(RTjpeg_height>>1); i++) - { - for(j=0; j>16; - b=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - g=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - r=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(int)((int)b >> 3); - tmp|=(int)(((int)g >> 2) << 5); - tmp|=(int)(((int)r >> 3) << 11); - *(bufoute++)=tmp&0xff; - *(bufoute++)=tmp>>8; - - - y=(bufy[j+1]-16)*Ky; - - tmp=(y+cbB)>>16; - b=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - g=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - r=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(int)((int)b >> 3); - tmp|=(int)(((int)g >> 2) << 5); - tmp|=(int)(((int)r >> 3) << 11); - *(bufoute++)=tmp&0xff; - *(bufoute++)=tmp>>8; - - y=(bufy[j+yskip]-16)*Ky; - - tmp=(y+cbB)>>16; - b=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - g=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - r=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(int)((int)b >> 3); - tmp|=(int)(((int)g >> 2) << 5); - tmp|=(int)(((int)r >> 3) << 11); - *(bufouto++)=tmp&0xff; - *(bufouto++)=tmp>>8; - - y=(bufy[j+1+yskip]-16)*Ky; - - tmp=(y+cbB)>>16; - b=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y-crG-cbG)>>16; - g=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(y+crR)>>16; - r=(tmp>255)?255:((tmp<0)?0:tmp); - tmp=(int)((int)b >> 3); - tmp|=(int)(((int)g >> 2) << 5); - tmp|=(int)(((int)r >> 3) << 11); - *(bufouto++)=tmp&0xff; - *(bufouto++)=tmp>>8; - - } - bufoute+=oskip; - bufouto+=oskip; - bufy+=yskip<<1; - } -} - -/* fix stride */ - -static void RTjpeg_yuvrgb8(__u8 *buf, __u8 *rgb, int stride) -{ - memcpy(rgb, buf, RTjpeg_width*RTjpeg_height); -} - From 7903f65ee88010a3cd45df78e181120ee5482046 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 13:17:18 +0000 Subject: [PATCH 24/89] Remove the grayscale and 4:2:2 RTjpeg code, it is neither used nor is there anything special about to to justify preserving it for documentation purposes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28886 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/native/rtjpegn.c | 257 ----------------------------------- 1 file changed, 257 deletions(-) diff --git a/libmpcodecs/native/rtjpegn.c b/libmpcodecs/native/rtjpegn.c index 662b117e40..165ad71e2e 100644 --- a/libmpcodecs/native/rtjpegn.c +++ b/libmpcodecs/native/rtjpegn.c @@ -2907,126 +2907,6 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) return (sp-sb); } -static int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp) -{ - __s8 * sb; - register __s8 * bp2 = bp + RTjpeg_Ysize; - register __s8 * bp3 = bp2 + RTjpeg_Csize; - register int i, j, k; - -#if HAVE_MMX - emms(); -#endif - sb=sp; -/* Y */ - for(i=RTjpeg_height; i; i-=8) - { - for(j=0, k=0; j>1); - } - if(*sp==-1)sp++; - else - { - sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); - RTjpeg_idct(bp3+k, RTjpeg_block, RTjpeg_width>>1); - } - } - bp+=RTjpeg_width<<3; - bp2+=RTjpeg_width<<2; - bp3+=RTjpeg_width<<2; - } -#if HAVE_MMX - emms(); -#endif -} - void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp) { register __s8 * bp1 = bp + (RTjpeg_width<<3); @@ -3089,28 +2969,6 @@ void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp) #endif } -static void RTjpeg_decompress8(__s8 *sp, __u8 *bp) -{ - int i, j; - -#if HAVE_MMX - emms(); -#endif - -/* Y */ - for(i=0; i Date: Sun, 8 Mar 2009 13:21:00 +0000 Subject: [PATCH 25/89] Get rid of pointless debugging code git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28887 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/native/rtjpegn.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/libmpcodecs/native/rtjpegn.c b/libmpcodecs/native/rtjpegn.c index 165ad71e2e..3aa1faac74 100644 --- a/libmpcodecs/native/rtjpegn.c +++ b/libmpcodecs/native/rtjpegn.c @@ -92,7 +92,6 @@ static mmx_t RTjpeg_cmask; static __u16 RTjpeg_lmask; static __u16 RTjpeg_cmask; #endif -static int RTjpeg_mtest=0; static const unsigned char RTjpeg_lum_quant_tbl[64] = { 16, 11, 10, 16, 24, 40, 51, 61, @@ -150,11 +149,6 @@ static int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) #endif -// *strm++ = 0x10; -// *strm = 0x00; -// -// return 2; - // first byte allways written ((__u8*)strm)[0]= (__u8)(data[RTjpeg_ZZ[0]]>254) ? 254:((data[RTjpeg_ZZ[0]]<0)?0:data[RTjpeg_ZZ[0]]); @@ -2849,8 +2843,6 @@ void RTjpeg_init_decompress(__u32 *buf, int width, int height) RTjpeg_cb8--; RTjpeg_idct_init(); - -// RTjpeg_color_init(); } int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) @@ -3035,11 +3027,8 @@ static int RTjpeg_bcomp(__s16 *old, mmx_t *mask) if(result.q) { -// if(!RTjpeg_mtest) -// for(i=0; i<16; i++)((__u64 *)old)[i]=((__u64 *)RTjpeg_block)[i]; return 0; } -// printf("."); return 1; } @@ -3051,7 +3040,6 @@ static int RTjpeg_bcomp(__s16 *old, __u16 *mask) for(i=0; i<64; i++) if(abs(old[i]-RTjpeg_block[i])>*mask) { - if(!RTjpeg_mtest) for(i=0; i<16; i++)((__u64 *)old)[i]=((__u64 *)RTjpeg_block)[i]; return 0; } @@ -3059,15 +3047,9 @@ static int RTjpeg_bcomp(__s16 *old, __u16 *mask) } #endif -static void RTjpeg_set_test(int i) -{ - RTjpeg_mtest=i; -} - int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask) { __s8 * sb; -//rh __s16 *block; register __s8 * bp1 = bp + (RTjpeg_width<<3); register __s8 * bp2 = bp + RTjpeg_Ysize; register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); From 276a73e2f29cce0c0e2dc18aa0e9e804b812762b Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 13:32:42 +0000 Subject: [PATCH 26/89] Remove internal NuppelVideo decoder, the code in libavcodec can decode those files and some more and is far more maintainable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28888 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 2 - etc/codecs.conf | 8 - libmpcodecs/native/nuppelvideo.c | 114 --- libmpcodecs/native/rtjpegn.c | 1380 ------------------------------ libmpcodecs/native/rtjpegn.h | 2 - libmpcodecs/vd.c | 2 - libmpcodecs/vd_nuv.c | 54 -- 7 files changed, 1562 deletions(-) delete mode 100644 libmpcodecs/native/nuppelvideo.c delete mode 100644 libmpcodecs/vd_nuv.c diff --git a/Makefile b/Makefile index f3a78b2de3..49a92e15d5 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,6 @@ SRCS_COMMON = asxparser.c \ libmpcodecs/dec_video.c \ libmpcodecs/img_format.c \ libmpcodecs/mp_image.c \ - libmpcodecs/native/nuppelvideo.c \ libmpcodecs/native/rtjpegn.c \ libmpcodecs/native/xa_gsm.c \ libmpcodecs/pullup.c \ @@ -102,7 +101,6 @@ SRCS_COMMON = asxparser.c \ libmpcodecs/vd_mpegpes.c \ libmpcodecs/vd_mtga.c \ libmpcodecs/vd_null.c \ - libmpcodecs/vd_nuv.c \ libmpcodecs/vd_raw.c \ libmpcodecs/vd_sgi.c \ libmpcodecs/vf.c \ diff --git a/etc/codecs.conf b/etc/codecs.conf index f9dcf8fc76..c824ab9903 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -319,14 +319,6 @@ videocodec ffnuv dll nuv out I420 -videocodec nuv - info "NuppelVideo" - status working - fourcc NUV1 ; NUV1 is an internal MPlayer FOURCC - fourcc RJPG - driver nuv - out I420,IYUV - videocodec ffbmp info "FFmpeg BMP" status working diff --git a/libmpcodecs/native/nuppelvideo.c b/libmpcodecs/native/nuppelvideo.c deleted file mode 100644 index 8128f85c47..0000000000 --- a/libmpcodecs/native/nuppelvideo.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * NuppelVideo 0.05 file parser - * for MPlayer - * by Panagiotis Issaris - * - * Reworked by alex - */ - -#include -#include -#include -#include - -#include "config.h" -#include "mp_msg.h" -#include "mpbswap.h" - -#include "libvo/fastmemcpy.h" - -#include "libmpdemux/nuppelvideo.h" -#include "rtjpegn.h" -#include "libavutil/lzo.h" - -#define KEEP_BUFFER - -void decode_nuv( unsigned char *encoded, int encoded_size, - unsigned char *decoded, int width, int height) -{ - int r; - unsigned int out_len = width * height + ( width * height ) / 2; - struct rtframeheader *encodedh = ( struct rtframeheader* ) encoded; - static unsigned char *buffer = 0; /* for RTJpeg with LZO decompress */ -#ifdef KEEP_BUFFER - static unsigned char *previous_buffer = 0; /* to support Last-frame-copy */ -#endif - -// printf("frametype: %c, comtype: %c, encoded_size: %d, width: %d, height: %d\n", -// encodedh->frametype, encodedh->comptype, encoded_size, width, height); - - le2me_rtframeheader(encodedh); - switch(encodedh->frametype) - { - case 'D': /* additional data for compressors */ - { - /* tables are in encoded */ - if (encodedh->comptype == 'R') - { - RTjpeg_init_decompress ( (unsigned long *)(encoded+12), width, height ); - mp_msg(MSGT_DECVIDEO, MSGL_V, "Found RTjpeg tables (size: %d, width: %d, height: %d)\n", - encoded_size-12, width, height); - } - break; - } - case 'V': - { - int in_len = encodedh->packetlength; -#ifdef KEEP_BUFFER - if (!previous_buffer) - previous_buffer = ( unsigned char * ) malloc ( out_len + AV_LZO_OUTPUT_PADDING ); -#endif - - switch(encodedh->comptype) - { - case '0': /* raw YUV420 */ - fast_memcpy(decoded, encoded + 12, out_len); - break; - case '1': /* RTJpeg */ - RTjpeg_decompressYUV420 ( ( __s8 * ) encoded + 12, decoded ); - break; - case '2': /* RTJpeg with LZO */ - if (!buffer) - buffer = ( unsigned char * ) malloc ( out_len + AV_LZO_OUTPUT_PADDING ); - if (!buffer) - { - mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Nuppelvideo: error decompressing\n"); - break; - } - r = av_lzo1x_decode ( buffer, &out_len, encoded + 12, &in_len ); - if ( r ) - { - mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Nuppelvideo: error decompressing\n"); - break; - } - RTjpeg_decompressYUV420 ( ( __s8 * ) buffer, decoded ); - break; - case '3': /* raw YUV420 with LZO */ - r = av_lzo1x_decode ( decoded, &out_len, encoded + 12, &in_len ); - if ( r ) - { - mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Nuppelvideo: error decompressing\n"); - break; - } - break; - case 'N': /* black frame */ - memset ( decoded, 0, width * height ); - memset ( decoded + width * height, 127, width * height / 2); - break; - case 'L': /* copy last frame */ -#ifdef KEEP_BUFFER - fast_memcpy ( decoded, previous_buffer, width*height*3/2); -#endif - break; - } - -#ifdef KEEP_BUFFER - fast_memcpy(previous_buffer, decoded, width*height*3/2); -#endif - break; - } - default: - mp_msg(MSGT_DECVIDEO, MSGL_V, "Nuppelvideo: unknwon frametype: %c\n", - encodedh->frametype); - } -} diff --git a/libmpcodecs/native/rtjpegn.c b/libmpcodecs/native/rtjpegn.c index 3aa1faac74..0eea073b61 100644 --- a/libmpcodecs/native/rtjpegn.c +++ b/libmpcodecs/native/rtjpegn.c @@ -293,152 +293,6 @@ fprintf(stdout, "\n\n"); return (int)co; } -/* +++++++++++++++++++++++++++++++++++++++++++++++++++*/ -/* Stream to Block (decoding) */ -/* */ - -static int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) -{ - int ci; - register int co; - register int i; - register unsigned char bitten; - register unsigned char bitoff; - - /* first byte always read */ - i=RTjpeg_ZZ[0]; - data[i]=((__u8)strm[0])*qtbl[i]; - - /* we start at the behind */ - - bitten = ((unsigned char)strm[1]) >> 2; - co = 63; - for(; co > bitten; co--) { - - data[RTjpeg_ZZ[co]] = 0; - - } - - if (co==0) { - ci = 2; - goto AUTOBAHN; - } - - /* we have to read the last 2 bits of the second byte */ - ci=1; - bitoff = 0; - - for(; co>0; co--) { - - bitten = ((unsigned char)strm[ci]) >> bitoff; - bitten &= 0x03; - - i=RTjpeg_ZZ[co]; - - switch( bitten ) { - case 0x03: - data[i]= -qtbl[i]; - break; - case 0x02: - goto FUSSWEG; - break; - case 0x01: - data[i]= qtbl[i]; - break; - case 0x00: - data[i]= 0; - break; - default: - break; - } - - if( bitoff == 0 ) { - bitoff = 8; - ci++; - } - bitoff -= 2; - } - /* co is 0 now */ - /* data is written properly */ - - /* if bitoff!=6 then ci is the index, but should be the byte count, so we increment by 1 */ - if (bitoff!=6) ci++; - - goto AUTOBAHN; - - -FUSSWEG: -/* correct bitoff to nibble */ - switch(bitoff){ - case 4: - case 6: - bitoff = 0; - break; - case 2: - case 0: - /* we have to read from the next byte */ - ci++; - bitoff = 4; - break; - default: - break; - } - - for(; co>0; co--) { - - bitten = ((unsigned char)strm[ci]) >> bitoff; - bitten &= 0x0f; - - i=RTjpeg_ZZ[co]; - - if( bitten == 0x08 ) { - goto STRASSE; - } - - /* the compiler cannot do sign extension for signed nibbles */ - if( bitten & 0x08 ) { - bitten |= 0xf0; - } - /* the unsigned char bitten now is a valid signed char */ - - data[i]=((signed char)bitten)*qtbl[i]; - - if( bitoff == 0 ) { - bitoff = 8; - ci++; - } - bitoff -= 4; - } - /* co is 0 */ - - /* if bitoff!=4 then ci is the index, but should be the byte count, so we increment by 1 */ - if (bitoff!=4) ci++; - - goto AUTOBAHN; - -STRASSE: - ci++; - - for(; co>0; co--) { - i=RTjpeg_ZZ[co]; - data[i]=strm[ci++]*qtbl[i]; - } - - /* ci now is the count, because it points to next element => no incrementing */ - -AUTOBAHN: - -#ifdef SHOWBLOCK -fprintf(stdout, "\nci = '%d'\n", ci); - for (i=0; i < 64; i++) { - fprintf(stdout, "%d ", data[RTjpeg_ZZ[i]]); - } -fprintf(stdout, "\n\n"); -#endif - - return ci; -} - #else static int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) @@ -1536,1148 +1390,6 @@ static void RTjpeg_dctY(__u8 *idata, __s16 *odata, int rskip) #endif } -#define FIX_1_082392200 ((__s32) 277) /* FIX(1.082392200) */ -#define FIX_1_414213562 ((__s32) 362) /* FIX(1.414213562) */ -#define FIX_1_847759065 ((__s32) 473) /* FIX(1.847759065) */ -#define FIX_2_613125930 ((__s32) 669) /* FIX(2.613125930) */ - -#define DESCALE(x) (__s16)( ((x)+4) >> 3) - -/* clip yuv to 16..235 (should be 16..240 for cr/cb but ... */ - -#define RL(x) ((x)>235) ? 235 : (((x)<16) ? 16 : (x)) -#define MULTIPLY(var,const) (((__s32) ((var) * (const)) + 128)>>8) - -static void RTjpeg_idct_init(void) -{ - int i; - - for(i=0; i<64; i++) - { - RTjpeg_liqt[i]=((__u64)RTjpeg_liqt[i]*RTjpeg_aan_tab[i])>>32; - RTjpeg_ciqt[i]=((__u64)RTjpeg_ciqt[i]*RTjpeg_aan_tab[i])>>32; - } -} - -static void RTjpeg_idct(__u8 *odata, __s16 *data, int rskip) -{ -#if HAVE_MMX - -static mmx_t fix_141 = {0x5a825a825a825a82LL}; -static mmx_t fix_184n261 = {0xcf04cf04cf04cf04LL}; -static mmx_t fix_184 = {0x7641764176417641LL}; -static mmx_t fix_n184 = {0x896f896f896f896fLL}; -static mmx_t fix_108n184 = {0xcf04cf04cf04cf04LL}; - - mmx_t workspace[64]; - mmx_t *wsptr = workspace; - register mmx_t *dataptr = (mmx_t *)odata; - mmx_t *idata = (mmx_t *)data; - - rskip = rskip>>3; -/* - * Perform inverse DCT on one block of coefficients. - */ - - /* Odd part */ - - movq_m2r(*(idata+10), mm1); // load idata[DCTSIZE*5] - - movq_m2r(*(idata+6), mm0); // load idata[DCTSIZE*3] - - movq_m2r(*(idata+2), mm3); // load idata[DCTSIZE*1] - - movq_r2r(mm1, mm2); // copy tmp6 /* phase 6 */ - - movq_m2r(*(idata+14), mm4); // load idata[DCTSIZE*7] - - paddw_r2r(mm0, mm1); // z13 = tmp6 + tmp5; - - psubw_r2r(mm0, mm2); // z10 = tmp6 - tmp5 - - psllw_i2r(2, mm2); // shift z10 - movq_r2r(mm2, mm0); // copy z10 - - pmulhw_m2r(fix_184n261, mm2); // MULTIPLY( z12, FIX_1_847759065); /* 2*c2 */ - movq_r2r(mm3, mm5); // copy tmp4 - - pmulhw_m2r(fix_n184, mm0); // MULTIPLY(z10, -FIX_1_847759065); /* 2*c2 */ - paddw_r2r(mm4, mm3); // z11 = tmp4 + tmp7; - - movq_r2r(mm3, mm6); // copy z11 /* phase 5 */ - psubw_r2r(mm4, mm5); // z12 = tmp4 - tmp7; - - psubw_r2r(mm1, mm6); // z11-z13 - psllw_i2r(2, mm5); // shift z12 - - movq_m2r(*(idata+12), mm4); // load idata[DCTSIZE*6], even part - movq_r2r(mm5, mm7); // copy z12 - - pmulhw_m2r(fix_108n184, mm5); // MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; /* 2*(c2-c6) */ even part - paddw_r2r(mm1, mm3); // tmp7 = z11 + z13; - - //ok - - /* Even part */ - pmulhw_m2r(fix_184, mm7); // MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; /* -2*(c2+c6) */ - psllw_i2r(2, mm6); - - movq_m2r(*(idata+4), mm1); // load idata[DCTSIZE*2] - - paddw_r2r(mm5, mm0); // tmp10 - - paddw_r2r(mm7, mm2); // tmp12 - - pmulhw_m2r(fix_141, mm6); // tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ - psubw_r2r(mm3, mm2); // tmp6 = tmp12 - tmp7 - - movq_r2r(mm1, mm5); // copy tmp1 - paddw_r2r(mm4, mm1); // tmp13= tmp1 + tmp3; /* phases 5-3 */ - - psubw_r2r(mm4, mm5); // tmp1-tmp3 - psubw_r2r(mm2, mm6); // tmp5 = tmp11 - tmp6; - - movq_r2m(mm1, *(wsptr)); // save tmp13 in workspace - psllw_i2r(2, mm5); // shift tmp1-tmp3 - - movq_m2r(*(idata), mm7); // load idata[DCTSIZE*0] - - pmulhw_m2r(fix_141, mm5); // MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - paddw_r2r(mm6, mm0); // tmp4 = tmp10 + tmp5; - - movq_m2r(*(idata+8), mm4); // load idata[DCTSIZE*4] - - psubw_r2r(mm1, mm5); // tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */ - - movq_r2m(mm0, *(wsptr+4)); // save tmp4 in workspace - movq_r2r(mm7, mm1); // copy tmp0 /* phase 3 */ - - movq_r2m(mm5, *(wsptr+2)); // save tmp12 in workspace - psubw_r2r(mm4, mm1); // tmp11 = tmp0 - tmp2; - - paddw_r2r(mm4, mm7); // tmp10 = tmp0 + tmp2; - movq_r2r(mm1, mm5); // copy tmp11 - - paddw_m2r(*(wsptr+2), mm1); // tmp1 = tmp11 + tmp12; - movq_r2r(mm7, mm4); // copy tmp10 /* phase 2 */ - - paddw_m2r(*(wsptr), mm7); // tmp0 = tmp10 + tmp13; - - psubw_m2r(*(wsptr), mm4); // tmp3 = tmp10 - tmp13; - movq_r2r(mm7, mm0); // copy tmp0 - - psubw_m2r(*(wsptr+2), mm5); // tmp2 = tmp11 - tmp12; - paddw_r2r(mm3, mm7); // wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); - - psubw_r2r(mm3, mm0); // wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); - - movq_r2m(mm7, *(wsptr)); // wsptr[DCTSIZE*0] - movq_r2r(mm1, mm3); // copy tmp1 - - movq_r2m(mm0, *(wsptr+14)); // wsptr[DCTSIZE*7] - paddw_r2r(mm2, mm1); // wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); - - psubw_r2r(mm2, mm3); // wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); - - movq_r2m(mm1, *(wsptr+2)); // wsptr[DCTSIZE*1] - movq_r2r(mm4, mm1); // copy tmp3 - - movq_r2m(mm3, *(wsptr+12)); // wsptr[DCTSIZE*6] - - paddw_m2r(*(wsptr+4), mm4); // wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); - - psubw_m2r(*(wsptr+4), mm1); // wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); - - movq_r2m(mm4, *(wsptr+8)); - movq_r2r(mm5, mm7); // copy tmp2 - - paddw_r2r(mm6, mm5); // wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) - - movq_r2m(mm1, *(wsptr+6)); - psubw_r2r(mm6, mm7); // wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); - - movq_r2m(mm5, *(wsptr+4)); - - movq_r2m(mm7, *(wsptr+10)); - - //ok - - -/*****************************************************************/ - - idata++; - wsptr++; - -/*****************************************************************/ - - movq_m2r(*(idata+10), mm1); // load idata[DCTSIZE*5] - - movq_m2r(*(idata+6), mm0); // load idata[DCTSIZE*3] - - movq_m2r(*(idata+2), mm3); // load idata[DCTSIZE*1] - movq_r2r(mm1, mm2); // copy tmp6 /* phase 6 */ - - movq_m2r(*(idata+14), mm4); // load idata[DCTSIZE*7] - paddw_r2r(mm0, mm1); // z13 = tmp6 + tmp5; - - psubw_r2r(mm0, mm2); // z10 = tmp6 - tmp5 - - psllw_i2r(2, mm2); // shift z10 - movq_r2r(mm2, mm0); // copy z10 - - pmulhw_m2r(fix_184n261, mm2); // MULTIPLY( z12, FIX_1_847759065); /* 2*c2 */ - movq_r2r(mm3, mm5); // copy tmp4 - - pmulhw_m2r(fix_n184, mm0); // MULTIPLY(z10, -FIX_1_847759065); /* 2*c2 */ - paddw_r2r(mm4, mm3); // z11 = tmp4 + tmp7; - - movq_r2r(mm3, mm6); // copy z11 /* phase 5 */ - psubw_r2r(mm4, mm5); // z12 = tmp4 - tmp7; - - psubw_r2r(mm1, mm6); // z11-z13 - psllw_i2r(2, mm5); // shift z12 - - movq_m2r(*(idata+12), mm4); // load idata[DCTSIZE*6], even part - movq_r2r(mm5, mm7); // copy z12 - - pmulhw_m2r(fix_108n184, mm5); // MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; /* 2*(c2-c6) */ even part - paddw_r2r(mm1, mm3); // tmp7 = z11 + z13; - - //ok - - /* Even part */ - pmulhw_m2r(fix_184, mm7); // MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; /* -2*(c2+c6) */ - psllw_i2r(2, mm6); - - movq_m2r(*(idata+4), mm1); // load idata[DCTSIZE*2] - - paddw_r2r(mm5, mm0); // tmp10 - - paddw_r2r(mm7, mm2); // tmp12 - - pmulhw_m2r(fix_141, mm6); // tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ - psubw_r2r(mm3, mm2); // tmp6 = tmp12 - tmp7 - - movq_r2r(mm1, mm5); // copy tmp1 - paddw_r2r(mm4, mm1); // tmp13= tmp1 + tmp3; /* phases 5-3 */ - - psubw_r2r(mm4, mm5); // tmp1-tmp3 - psubw_r2r(mm2, mm6); // tmp5 = tmp11 - tmp6; - - movq_r2m(mm1, *(wsptr)); // save tmp13 in workspace - psllw_i2r(2, mm5); // shift tmp1-tmp3 - - movq_m2r(*(idata), mm7); // load idata[DCTSIZE*0] - paddw_r2r(mm6, mm0); // tmp4 = tmp10 + tmp5; - - pmulhw_m2r(fix_141, mm5); // MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - - movq_m2r(*(idata+8), mm4); // load idata[DCTSIZE*4] - - psubw_r2r(mm1, mm5); // tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */ - - movq_r2m(mm0, *(wsptr+4)); // save tmp4 in workspace - movq_r2r(mm7, mm1); // copy tmp0 /* phase 3 */ - - movq_r2m(mm5, *(wsptr+2)); // save tmp12 in workspace - psubw_r2r(mm4, mm1); // tmp11 = tmp0 - tmp2; - - paddw_r2r(mm4, mm7); // tmp10 = tmp0 + tmp2; - movq_r2r(mm1, mm5); // copy tmp11 - - paddw_m2r(*(wsptr+2), mm1); // tmp1 = tmp11 + tmp12; - movq_r2r(mm7, mm4); // copy tmp10 /* phase 2 */ - - paddw_m2r(*(wsptr), mm7); // tmp0 = tmp10 + tmp13; - - psubw_m2r(*(wsptr), mm4); // tmp3 = tmp10 - tmp13; - movq_r2r(mm7, mm0); // copy tmp0 - - psubw_m2r(*(wsptr+2), mm5); // tmp2 = tmp11 - tmp12; - paddw_r2r(mm3, mm7); // wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); - - psubw_r2r(mm3, mm0); // wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); - - movq_r2m(mm7, *(wsptr)); // wsptr[DCTSIZE*0] - movq_r2r(mm1, mm3); // copy tmp1 - - movq_r2m(mm0, *(wsptr+14)); // wsptr[DCTSIZE*7] - paddw_r2r(mm2, mm1); // wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); - - psubw_r2r(mm2, mm3); // wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); - - movq_r2m(mm1, *(wsptr+2)); // wsptr[DCTSIZE*1] - movq_r2r(mm4, mm1); // copy tmp3 - - movq_r2m(mm3, *(wsptr+12)); // wsptr[DCTSIZE*6] - - paddw_m2r(*(wsptr+4), mm4); // wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); - - psubw_m2r(*(wsptr+4), mm1); // wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); - - movq_r2m(mm4, *(wsptr+8)); - movq_r2r(mm5, mm7); // copy tmp2 - - paddw_r2r(mm6, mm5); // wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) - - movq_r2m(mm1, *(wsptr+6)); - psubw_r2r(mm6, mm7); // wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); - - movq_r2m(mm5, *(wsptr+4)); - - movq_r2m(mm7, *(wsptr+10)); - -/*****************************************************************/ - - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ - -/*****************************************************************/ - /* Even part */ - - wsptr--; - -// tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); -// tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); -// tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); -// tmp14 = ((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6]); - movq_m2r(*(wsptr), mm0); // wsptr[0,0],[0,1],[0,2],[0,3] - - movq_m2r(*(wsptr+1), mm1); // wsptr[0,4],[0,5],[0,6],[0,7] - movq_r2r(mm0, mm2); - - movq_m2r(*(wsptr+2), mm3); // wsptr[1,0],[1,1],[1,2],[1,3] - paddw_r2r(mm1, mm0); // wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] - - movq_m2r(*(wsptr+3), mm4); // wsptr[1,4],[1,5],[1,6],[1,7] - psubw_r2r(mm1, mm2); // wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] - - movq_r2r(mm0, mm6); - movq_r2r(mm3, mm5); - - paddw_r2r(mm4, mm3); // wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] - movq_r2r(mm2, mm1); - - psubw_r2r(mm4, mm5); // wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] - punpcklwd_r2r(mm3, mm0); // wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] - - movq_m2r(*(wsptr+7), mm7); // wsptr[3,4],[3,5],[3,6],[3,7] - punpckhwd_r2r(mm3, mm6); // wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] - - movq_m2r(*(wsptr+4), mm3); // wsptr[2,0],[2,1],[2,2],[2,3] - punpckldq_r2r(mm6, mm0); // wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] - - punpcklwd_r2r(mm5, mm1); // wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] - movq_r2r(mm3, mm4); - - movq_m2r(*(wsptr+6), mm6); // wsptr[3,0],[3,1],[3,2],[3,3] - punpckhwd_r2r(mm5, mm2); // wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] - - movq_m2r(*(wsptr+5), mm5); // wsptr[2,4],[2,5],[2,6],[2,7] - punpckldq_r2r(mm2, mm1); // wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] - - - paddw_r2r(mm5, mm3); // wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] - movq_r2r(mm6, mm2); - - psubw_r2r(mm5, mm4); // wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] - paddw_r2r(mm7, mm6); // wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] - - movq_r2r(mm3, mm5); - punpcklwd_r2r(mm6, mm3); // wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] - - psubw_r2r(mm7, mm2); // wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] - punpckhwd_r2r(mm6, mm5); // wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] - - movq_r2r(mm4, mm7); - punpckldq_r2r(mm5, mm3); // wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] - - punpcklwd_r2r(mm2, mm4); // wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] - - punpckhwd_r2r(mm2, mm7); // wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] - - punpckldq_r2r(mm7, mm4); // wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] - movq_r2r(mm1, mm6); - - //ok - -// mm0 = ;wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] -// mm1 = ;wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] - - - movq_r2r(mm0, mm2); - punpckhdq_r2r(mm4, mm6); // wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] - - punpckldq_r2r(mm4, mm1); // wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] - psllw_i2r(2, mm6); - - pmulhw_m2r(fix_141, mm6); - punpckldq_r2r(mm3, mm0); // wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] - - punpckhdq_r2r(mm3, mm2); // wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] - movq_r2r(mm0, mm7); - -// tmp0 = tmp10 + tmp13; -// tmp3 = tmp10 - tmp13; - paddw_r2r(mm2, mm0); // [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] - psubw_r2r(mm2, mm7); // [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] - -// tmp12 = MULTIPLY(tmp14, FIX_1_414213562) - tmp13; - psubw_r2r(mm2, mm6); // wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] -// tmp1 = tmp11 + tmp12; -// tmp2 = tmp11 - tmp12; - movq_r2r(mm1, mm5); - - //OK - - /* Odd part */ - -// z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3]; -// z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; -// z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; -// z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; - movq_m2r(*(wsptr), mm3); // wsptr[0,0],[0,1],[0,2],[0,3] - paddw_r2r(mm6, mm1); // [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] - - movq_m2r(*(wsptr+1), mm4); // wsptr[0,4],[0,5],[0,6],[0,7] - psubw_r2r(mm6, mm5); // [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] - - movq_r2r(mm3, mm6); - punpckldq_r2r(mm4, mm3); // wsptr[0,0],[0,1],[0,4],[0,5] - - punpckhdq_r2r(mm6, mm4); // wsptr[0,6],[0,7],[0,2],[0,3] - movq_r2r(mm3, mm2); - -//Save tmp0 and tmp1 in wsptr - movq_r2m(mm0, *(wsptr)); // save tmp0 - paddw_r2r(mm4, mm2); // wsptr[xxx],[0,z11],[xxx],[0,z13] - - -//Continue with z10 --- z13 - movq_m2r(*(wsptr+2), mm6); // wsptr[1,0],[1,1],[1,2],[1,3] - psubw_r2r(mm4, mm3); // wsptr[xxx],[0,z12],[xxx],[0,z10] - - movq_m2r(*(wsptr+3), mm0); // wsptr[1,4],[1,5],[1,6],[1,7] - movq_r2r(mm6, mm4); - - movq_r2m(mm1, *(wsptr+1)); // save tmp1 - punpckldq_r2r(mm0, mm6); // wsptr[1,0],[1,1],[1,4],[1,5] - - punpckhdq_r2r(mm4, mm0); // wsptr[1,6],[1,7],[1,2],[1,3] - movq_r2r(mm6, mm1); - -//Save tmp2 and tmp3 in wsptr - paddw_r2r(mm0, mm6); // wsptr[xxx],[1,z11],[xxx],[1,z13] - movq_r2r(mm2, mm4); - -//Continue with z10 --- z13 - movq_r2m(mm5, *(wsptr+2)); // save tmp2 - punpcklwd_r2r(mm6, mm2); // wsptr[xxx],[xxx],[0,z11],[1,z11] - - psubw_r2r(mm0, mm1); // wsptr[xxx],[1,z12],[xxx],[1,z10] - punpckhwd_r2r(mm6, mm4); // wsptr[xxx],[xxx],[0,z13],[1,z13] - - movq_r2r(mm3, mm0); - punpcklwd_r2r(mm1, mm3); // wsptr[xxx],[xxx],[0,z12],[1,z12] - - movq_r2m(mm7, *(wsptr+3)); // save tmp3 - punpckhwd_r2r(mm1, mm0); // wsptr[xxx],[xxx],[0,z10],[1,z10] - - movq_m2r(*(wsptr+4), mm6); // wsptr[2,0],[2,1],[2,2],[2,3] - punpckhdq_r2r(mm2, mm0); // wsptr[0,z10],[1,z10],[0,z11],[1,z11] - - movq_m2r(*(wsptr+5), mm7); // wsptr[2,4],[2,5],[2,6],[2,7] - punpckhdq_r2r(mm4, mm3); // wsptr[0,z12],[1,z12],[0,z13],[1,z13] - - movq_m2r(*(wsptr+6), mm1); // wsptr[3,0],[3,1],[3,2],[3,3] - movq_r2r(mm6, mm4); - - punpckldq_r2r(mm7, mm6); // wsptr[2,0],[2,1],[2,4],[2,5] - movq_r2r(mm1, mm5); - - punpckhdq_r2r(mm4, mm7); // wsptr[2,6],[2,7],[2,2],[2,3] - movq_r2r(mm6, mm2); - - movq_m2r(*(wsptr+7), mm4); // wsptr[3,4],[3,5],[3,6],[3,7] - paddw_r2r(mm7, mm6); // wsptr[xxx],[2,z11],[xxx],[2,z13] - - psubw_r2r(mm7, mm2); // wsptr[xxx],[2,z12],[xxx],[2,z10] - punpckldq_r2r(mm4, mm1); // wsptr[3,0],[3,1],[3,4],[3,5] - - punpckhdq_r2r(mm5, mm4); // wsptr[3,6],[3,7],[3,2],[3,3] - movq_r2r(mm1, mm7); - - paddw_r2r(mm4, mm1); // wsptr[xxx],[3,z11],[xxx],[3,z13] - psubw_r2r(mm4, mm7); // wsptr[xxx],[3,z12],[xxx],[3,z10] - - movq_r2r(mm6, mm5); - punpcklwd_r2r(mm1, mm6); // wsptr[xxx],[xxx],[2,z11],[3,z11] - - punpckhwd_r2r(mm1, mm5); // wsptr[xxx],[xxx],[2,z13],[3,z13] - movq_r2r(mm2, mm4); - - punpcklwd_r2r(mm7, mm2); // wsptr[xxx],[xxx],[2,z12],[3,z12] - - punpckhwd_r2r(mm7, mm4); // wsptr[xxx],[xxx],[2,z10],[3,z10] - - punpckhdq_r2r(mm6, mm4); /// wsptr[2,z10],[3,z10],[2,z11],[3,z11] - - punpckhdq_r2r(mm5, mm2); // wsptr[2,z12],[3,z12],[2,z13],[3,z13] - movq_r2r(mm0, mm5); - - punpckldq_r2r(mm4, mm0); // wsptr[0,z10],[1,z10],[2,z10],[3,z10] - - punpckhdq_r2r(mm4, mm5); // wsptr[0,z11],[1,z11],[2,z11],[3,z11] - movq_r2r(mm3, mm4); - - punpckhdq_r2r(mm2, mm4); // wsptr[0,z13],[1,z13],[2,z13],[3,z13] - movq_r2r(mm5, mm1); - - punpckldq_r2r(mm2, mm3); // wsptr[0,z12],[1,z12],[2,z12],[3,z12] -// tmp7 = z11 + z13; /* phase 5 */ -// tmp8 = z11 - z13; /* phase 5 */ - psubw_r2r(mm4, mm1); // tmp8 - - paddw_r2r(mm4, mm5); // tmp7 -// tmp21 = MULTIPLY(tmp8, FIX_1_414213562); /* 2*c4 */ - psllw_i2r(2, mm1); - - psllw_i2r(2, mm0); - - pmulhw_m2r(fix_141, mm1); // tmp21 -// tmp20 = MULTIPLY(z12, (FIX_1_082392200- FIX_1_847759065)) /* 2*(c2-c6) */ -// + MULTIPLY(z10, - FIX_1_847759065); /* 2*c2 */ - psllw_i2r(2, mm3); - movq_r2r(mm0, mm7); - - pmulhw_m2r(fix_n184, mm7); - movq_r2r(mm3, mm6); - - movq_m2r(*(wsptr), mm2); // tmp0,final1 - - pmulhw_m2r(fix_108n184, mm6); -// tmp22 = MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) /* -2*(c2+c6) */ -// + MULTIPLY(z12, FIX_1_847759065); /* 2*c2 */ - movq_r2r(mm2, mm4); // final1 - - pmulhw_m2r(fix_184n261, mm0); - paddw_r2r(mm5, mm2); // tmp0+tmp7,final1 - - pmulhw_m2r(fix_184, mm3); - psubw_r2r(mm5, mm4); // tmp0-tmp7,final1 - -// tmp6 = tmp22 - tmp7; /* phase 2 */ - psraw_i2r(3, mm2); // outptr[0,0],[1,0],[2,0],[3,0],final1 - - paddw_r2r(mm6, mm7); // tmp20 - psraw_i2r(3, mm4); // outptr[0,7],[1,7],[2,7],[3,7],final1 - - paddw_r2r(mm0, mm3); // tmp22 - -// tmp5 = tmp21 - tmp6; - psubw_r2r(mm5, mm3); // tmp6 - -// tmp4 = tmp20 + tmp5; - movq_m2r(*(wsptr+1), mm0); // tmp1,final2 - psubw_r2r(mm3, mm1); // tmp5 - - movq_r2r(mm0, mm6); // final2 - paddw_r2r(mm3, mm0); // tmp1+tmp6,final2 - - /* Final output stage: scale down by a factor of 8 and range-limit */ - - -// outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3) -// & RANGE_MASK]; -// outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3) -// & RANGE_MASK]; final1 - - -// outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3) -// & RANGE_MASK]; -// outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) -// & RANGE_MASK]; final2 - psubw_r2r(mm3, mm6); // tmp1-tmp6,final2 - psraw_i2r(3, mm0); // outptr[0,1],[1,1],[2,1],[3,1] - - psraw_i2r(3, mm6); // outptr[0,6],[1,6],[2,6],[3,6] - - packuswb_r2r(mm4, mm0); // out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7] - - movq_m2r(*(wsptr+2), mm5); // tmp2,final3 - packuswb_r2r(mm6, mm2); // out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6] - -// outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) -// & RANGE_MASK]; -// outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) -// & RANGE_MASK]; final3 - paddw_r2r(mm1, mm7); // tmp4 - movq_r2r(mm5, mm3); - - paddw_r2r(mm1, mm5); // tmp2+tmp5 - psubw_r2r(mm1, mm3); // tmp2-tmp5 - - psraw_i2r(3, mm5); // outptr[0,2],[1,2],[2,2],[3,2] - - movq_m2r(*(wsptr+3), mm4); // tmp3,final4 - psraw_i2r(3, mm3); // outptr[0,5],[1,5],[2,5],[3,5] - - - -// outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3) -// & RANGE_MASK]; -// outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) -// & RANGE_MASK]; final4 - movq_r2r(mm4, mm6); - paddw_r2r(mm7, mm4); // tmp3+tmp4 - - psubw_r2r(mm7, mm6); // tmp3-tmp4 - psraw_i2r(3, mm4); // outptr[0,4],[1,4],[2,4],[3,4] - - // mov ecx, [dataptr] - - psraw_i2r(3, mm6); // outptr[0,3],[1,3],[2,3],[3,3] - - packuswb_r2r(mm4, mm5); // out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4] - - packuswb_r2r(mm3, mm6); // out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5] - movq_r2r(mm2, mm4); - - movq_r2r(mm5, mm7); - punpcklbw_r2r(mm0, mm2); // out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1] - - punpckhbw_r2r(mm0, mm4); // out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7] - movq_r2r(mm2, mm1); - - punpcklbw_r2r(mm6, mm5); // out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3] - - // add dataptr, 4 - - punpckhbw_r2r(mm6, mm7); // out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5] - - punpcklwd_r2r(mm5, mm2); // out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3] - - // add ecx, output_col - - movq_r2r(mm7, mm6); - punpckhwd_r2r(mm5, mm1); // out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3] - - movq_r2r(mm2, mm0); - punpcklwd_r2r(mm4, mm6); // out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7] - - // mov idata, [dataptr] - - punpckldq_r2r(mm6, mm2); // out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7] - - // add dataptr, 4 - - movq_r2r(mm1, mm3); - - // add idata, output_col - - punpckhwd_r2r(mm4, mm7); // out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7] - - movq_r2m(mm2, *(dataptr)); - - punpckhdq_r2r(mm6, mm0); // out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7] - - dataptr += rskip; - movq_r2m(mm0, *(dataptr)); - - punpckldq_r2r(mm7, mm1); // out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7] - punpckhdq_r2r(mm7, mm3); // out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7] - - dataptr += rskip; - movq_r2m(mm1, *(dataptr)); - - dataptr += rskip; - movq_r2m(mm3, *(dataptr)); - -/*******************************************************************/ - - wsptr += 8; - -/*******************************************************************/ - -// tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); -// tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); -// tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); -// tmp14 = ((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6]); - movq_m2r(*(wsptr), mm0); // wsptr[0,0],[0,1],[0,2],[0,3] - - movq_m2r(*(wsptr+1), mm1); // wsptr[0,4],[0,5],[0,6],[0,7] - movq_r2r(mm0, mm2); - - movq_m2r(*(wsptr+2), mm3); // wsptr[1,0],[1,1],[1,2],[1,3] - paddw_r2r(mm1, mm0); // wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] - - movq_m2r(*(wsptr+3), mm4); // wsptr[1,4],[1,5],[1,6],[1,7] - psubw_r2r(mm1, mm2); // wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] - - movq_r2r(mm0, mm6); - movq_r2r(mm3, mm5); - - paddw_r2r(mm4, mm3); // wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] - movq_r2r(mm2, mm1); - - psubw_r2r(mm4, mm5); // wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] - punpcklwd_r2r(mm3, mm0); // wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] - - movq_m2r(*(wsptr+7), mm7); // wsptr[3,4],[3,5],[3,6],[3,7] - punpckhwd_r2r(mm3, mm6); // wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] - - movq_m2r(*(wsptr+4), mm3); // wsptr[2,0],[2,1],[2,2],[2,3] - punpckldq_r2r(mm6, mm0); // wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] - - punpcklwd_r2r(mm5, mm1); // wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] - movq_r2r(mm3, mm4); - - movq_m2r(*(wsptr+6), mm6); // wsptr[3,0],[3,1],[3,2],[3,3] - punpckhwd_r2r(mm5, mm2); // wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] - - movq_m2r(*(wsptr+5), mm5); // wsptr[2,4],[2,5],[2,6],[2,7] - punpckldq_r2r(mm2, mm1); // wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] - - paddw_r2r(mm5, mm3); // wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] - movq_r2r(mm6, mm2); - - psubw_r2r(mm5, mm4); // wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] - paddw_r2r(mm7, mm6); // wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] - - movq_r2r(mm3, mm5); - punpcklwd_r2r(mm6, mm3); // wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] - - psubw_r2r(mm7, mm2); // wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] - punpckhwd_r2r(mm6, mm5); // wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] - - movq_r2r(mm4, mm7); - punpckldq_r2r(mm5, mm3); // wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] - - punpcklwd_r2r(mm2, mm4); // wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] - - punpckhwd_r2r(mm2, mm7); // wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] - - punpckldq_r2r(mm7, mm4); // wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] - movq_r2r(mm1, mm6); - - //OK - -// mm0 = ;wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] -// mm1 = ;wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] - - movq_r2r(mm0, mm2); - punpckhdq_r2r(mm4, mm6); // wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] - - punpckldq_r2r(mm4, mm1); // wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] - psllw_i2r(2, mm6); - - pmulhw_m2r(fix_141, mm6); - punpckldq_r2r(mm3, mm0); // wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] - - punpckhdq_r2r(mm3, mm2); // wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] - movq_r2r(mm0, mm7); - -// tmp0 = tmp10 + tmp13; -// tmp3 = tmp10 - tmp13; - paddw_r2r(mm2, mm0); // [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] - psubw_r2r(mm2, mm7); // [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] - -// tmp12 = MULTIPLY(tmp14, FIX_1_414213562) - tmp13; - psubw_r2r(mm2, mm6); // wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] -// tmp1 = tmp11 + tmp12; -// tmp2 = tmp11 - tmp12; - movq_r2r(mm1, mm5); - - //OK - - - /* Odd part */ - -// z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3]; -// z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; -// z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; -// z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; - movq_m2r(*(wsptr), mm3); // wsptr[0,0],[0,1],[0,2],[0,3] - paddw_r2r(mm6, mm1); // [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] - - movq_m2r(*(wsptr+1), mm4); // wsptr[0,4],[0,5],[0,6],[0,7] - psubw_r2r(mm6, mm5); // [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] - - movq_r2r(mm3, mm6); - punpckldq_r2r(mm4, mm3); // wsptr[0,0],[0,1],[0,4],[0,5] - - punpckhdq_r2r(mm6, mm4); // wsptr[0,6],[0,7],[0,2],[0,3] - movq_r2r(mm3, mm2); - -//Save tmp0 and tmp1 in wsptr - movq_r2m(mm0, *(wsptr)); // save tmp0 - paddw_r2r(mm4, mm2); // wsptr[xxx],[0,z11],[xxx],[0,z13] - - -//Continue with z10 --- z13 - movq_m2r(*(wsptr+2), mm6); // wsptr[1,0],[1,1],[1,2],[1,3] - psubw_r2r(mm4, mm3); // wsptr[xxx],[0,z12],[xxx],[0,z10] - - movq_m2r(*(wsptr+3), mm0); // wsptr[1,4],[1,5],[1,6],[1,7] - movq_r2r(mm6, mm4); - - movq_r2m(mm1, *(wsptr+1)); // save tmp1 - punpckldq_r2r(mm0, mm6); // wsptr[1,0],[1,1],[1,4],[1,5] - - punpckhdq_r2r(mm4, mm0); // wsptr[1,6],[1,7],[1,2],[1,3] - movq_r2r(mm6, mm1); - -//Save tmp2 and tmp3 in wsptr - paddw_r2r(mm0, mm6); // wsptr[xxx],[1,z11],[xxx],[1,z13] - movq_r2r(mm2, mm4); - -//Continue with z10 --- z13 - movq_r2m(mm5, *(wsptr+2)); // save tmp2 - punpcklwd_r2r(mm6, mm2); // wsptr[xxx],[xxx],[0,z11],[1,z11] - - psubw_r2r(mm0, mm1); // wsptr[xxx],[1,z12],[xxx],[1,z10] - punpckhwd_r2r(mm6, mm4); // wsptr[xxx],[xxx],[0,z13],[1,z13] - - movq_r2r(mm3, mm0); - punpcklwd_r2r(mm1, mm3); // wsptr[xxx],[xxx],[0,z12],[1,z12] - - movq_r2m(mm7, *(wsptr+3)); // save tmp3 - punpckhwd_r2r(mm1, mm0); // wsptr[xxx],[xxx],[0,z10],[1,z10] - - movq_m2r(*(wsptr+4), mm6); // wsptr[2,0],[2,1],[2,2],[2,3] - punpckhdq_r2r(mm2, mm0); // wsptr[0,z10],[1,z10],[0,z11],[1,z11] - - movq_m2r(*(wsptr+5), mm7); // wsptr[2,4],[2,5],[2,6],[2,7] - punpckhdq_r2r(mm4, mm3); // wsptr[0,z12],[1,z12],[0,z13],[1,z13] - - movq_m2r(*(wsptr+6), mm1); // wsptr[3,0],[3,1],[3,2],[3,3] - movq_r2r(mm6, mm4); - - punpckldq_r2r(mm7, mm6); // wsptr[2,0],[2,1],[2,4],[2,5] - movq_r2r(mm1, mm5); - - punpckhdq_r2r(mm4, mm7); // wsptr[2,6],[2,7],[2,2],[2,3] - movq_r2r(mm6, mm2); - - movq_m2r(*(wsptr+7), mm4); // wsptr[3,4],[3,5],[3,6],[3,7] - paddw_r2r(mm7, mm6); // wsptr[xxx],[2,z11],[xxx],[2,z13] - - psubw_r2r(mm7, mm2); // wsptr[xxx],[2,z12],[xxx],[2,z10] - punpckldq_r2r(mm4, mm1); // wsptr[3,0],[3,1],[3,4],[3,5] - - punpckhdq_r2r(mm5, mm4); // wsptr[3,6],[3,7],[3,2],[3,3] - movq_r2r(mm1, mm7); - - paddw_r2r(mm4, mm1); // wsptr[xxx],[3,z11],[xxx],[3,z13] - psubw_r2r(mm4, mm7); // wsptr[xxx],[3,z12],[xxx],[3,z10] - - movq_r2r(mm6, mm5); - punpcklwd_r2r(mm1, mm6); // wsptr[xxx],[xxx],[2,z11],[3,z11] - - punpckhwd_r2r(mm1, mm5); // wsptr[xxx],[xxx],[2,z13],[3,z13] - movq_r2r(mm2, mm4); - - punpcklwd_r2r(mm7, mm2); // wsptr[xxx],[xxx],[2,z12],[3,z12] - - punpckhwd_r2r(mm7, mm4); // wsptr[xxx],[xxx],[2,z10],[3,z10] - - punpckhdq_r2r(mm6, mm4); // wsptr[2,z10],[3,z10],[2,z11],[3,z11] - - punpckhdq_r2r(mm5, mm2); // wsptr[2,z12],[3,z12],[2,z13],[3,z13] - movq_r2r(mm0, mm5); - - punpckldq_r2r(mm4, mm0); // wsptr[0,z10],[1,z10],[2,z10],[3,z10] - - punpckhdq_r2r(mm4, mm5); // wsptr[0,z11],[1,z11],[2,z11],[3,z11] - movq_r2r(mm3, mm4); - - punpckhdq_r2r(mm2, mm4); // wsptr[0,z13],[1,z13],[2,z13],[3,z13] - movq_r2r(mm5, mm1); - - punpckldq_r2r(mm2, mm3); // wsptr[0,z12],[1,z12],[2,z12],[3,z12] -// tmp7 = z11 + z13; /* phase 5 */ -// tmp8 = z11 - z13; /* phase 5 */ - psubw_r2r(mm4, mm1); // tmp8 - - paddw_r2r(mm4, mm5); // tmp7 -// tmp21 = MULTIPLY(tmp8, FIX_1_414213562); /* 2*c4 */ - psllw_i2r(2, mm1); - - psllw_i2r(2, mm0); - - pmulhw_m2r(fix_141, mm1); // tmp21 -// tmp20 = MULTIPLY(z12, (FIX_1_082392200- FIX_1_847759065)) /* 2*(c2-c6) */ -// + MULTIPLY(z10, - FIX_1_847759065); /* 2*c2 */ - psllw_i2r(2, mm3); - movq_r2r(mm0, mm7); - - pmulhw_m2r(fix_n184, mm7); - movq_r2r(mm3, mm6); - - movq_m2r(*(wsptr), mm2); // tmp0,final1 - - pmulhw_m2r(fix_108n184, mm6); -// tmp22 = MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) /* -2*(c2+c6) */ -// + MULTIPLY(z12, FIX_1_847759065); /* 2*c2 */ - movq_r2r(mm2, mm4); // final1 - - pmulhw_m2r(fix_184n261, mm0); - paddw_r2r(mm5, mm2); // tmp0+tmp7,final1 - - pmulhw_m2r(fix_184, mm3); - psubw_r2r(mm5, mm4); // tmp0-tmp7,final1 - -// tmp6 = tmp22 - tmp7; /* phase 2 */ - psraw_i2r(3, mm2); // outptr[0,0],[1,0],[2,0],[3,0],final1 - - paddw_r2r(mm6, mm7); // tmp20 - psraw_i2r(3, mm4); // outptr[0,7],[1,7],[2,7],[3,7],final1 - - paddw_r2r(mm0, mm3); // tmp22 - -// tmp5 = tmp21 - tmp6; - psubw_r2r(mm5, mm3); // tmp6 - -// tmp4 = tmp20 + tmp5; - movq_m2r(*(wsptr+1), mm0); // tmp1,final2 - psubw_r2r(mm3, mm1); // tmp5 - - movq_r2r(mm0, mm6); // final2 - paddw_r2r(mm3, mm0); // tmp1+tmp6,final2 - - /* Final output stage: scale down by a factor of 8 and range-limit */ - -// outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3) -// & RANGE_MASK]; -// outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3) -// & RANGE_MASK]; final1 - - -// outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3) -// & RANGE_MASK]; -// outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) -// & RANGE_MASK]; final2 - psubw_r2r(mm3, mm6); // tmp1-tmp6,final2 - psraw_i2r(3, mm0); // outptr[0,1],[1,1],[2,1],[3,1] - - psraw_i2r(3, mm6); // outptr[0,6],[1,6],[2,6],[3,6] - - packuswb_r2r(mm4, mm0); // out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7] - - movq_m2r(*(wsptr+2), mm5); // tmp2,final3 - packuswb_r2r(mm6, mm2); // out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6] - -// outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) -// & RANGE_MASK]; -// outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) -// & RANGE_MASK]; final3 - paddw_r2r(mm1, mm7); // tmp4 - movq_r2r(mm5, mm3); - - paddw_r2r(mm1, mm5); // tmp2+tmp5 - psubw_r2r(mm1, mm3); // tmp2-tmp5 - - psraw_i2r(3, mm5); // outptr[0,2],[1,2],[2,2],[3,2] - - movq_m2r(*(wsptr+3), mm4); // tmp3,final4 - psraw_i2r(3, mm3); // outptr[0,5],[1,5],[2,5],[3,5] - - - -// outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3) -// & RANGE_MASK]; -// outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) -// & RANGE_MASK]; final4 - movq_r2r(mm4, mm6); - paddw_r2r(mm7, mm4); // tmp3+tmp4 - - psubw_r2r(mm7, mm6); // tmp3-tmp4 - psraw_i2r(3, mm4); // outptr[0,4],[1,4],[2,4],[3,4] - - psraw_i2r(3, mm6); // outptr[0,3],[1,3],[2,3],[3,3] - - /* - movq_r2m(mm4, *dummy); - fprintf(stderr, "3-4 %016llx\n", dummy); - movq_r2m(mm4, *dummy); - fprintf(stderr, "3+4 %016llx\n", dummy); - */ - - - packuswb_r2r(mm4, mm5); // out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4] - - packuswb_r2r(mm3, mm6); // out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5] - movq_r2r(mm2, mm4); - - movq_r2r(mm5, mm7); - punpcklbw_r2r(mm0, mm2); // out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1] - - punpckhbw_r2r(mm0, mm4); // out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7] - movq_r2r(mm2, mm1); - - punpcklbw_r2r(mm6, mm5); // out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3] - - punpckhbw_r2r(mm6, mm7); // out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5] - - punpcklwd_r2r(mm5, mm2); // out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3] - - movq_r2r(mm7, mm6); - punpckhwd_r2r(mm5, mm1); // out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3] - - movq_r2r(mm2, mm0); - punpcklwd_r2r(mm4, mm6); // out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7] - - punpckldq_r2r(mm6, mm2); // out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7] - - movq_r2r(mm1, mm3); - - punpckhwd_r2r(mm4, mm7); // out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7] - - dataptr += rskip; - movq_r2m(mm2, *(dataptr)); - - punpckhdq_r2r(mm6, mm0); // out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7] - - dataptr += rskip; - movq_r2m(mm0, *(dataptr)); - - punpckldq_r2r(mm7, mm1); // out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7] - - punpckhdq_r2r(mm7, mm3); // out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7] - - dataptr += rskip; - movq_r2m(mm1, *(dataptr)); - - dataptr += rskip; - movq_r2m(mm3, *(dataptr)); - -#else - __s32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - __s32 tmp10, tmp11, tmp12, tmp13; - __s32 z5, z10, z11, z12, z13; - __s16 *inptr; - __s32 *wsptr; - __u8 *outptr; - int ctr; - __s32 dcval; - __s32 workspace[64]; - - inptr = data; - wsptr = workspace; - for (ctr = 8; ctr > 0; ctr--) { - - if ((inptr[8] | inptr[16] | inptr[24] | - inptr[32] | inptr[40] | inptr[48] | inptr[56]) == 0) { - dcval = inptr[0]; - wsptr[0] = dcval; - wsptr[8] = dcval; - wsptr[16] = dcval; - wsptr[24] = dcval; - wsptr[32] = dcval; - wsptr[40] = dcval; - wsptr[48] = dcval; - wsptr[56] = dcval; - - inptr++; - wsptr++; - continue; - } - - tmp0 = inptr[0]; - tmp1 = inptr[16]; - tmp2 = inptr[32]; - tmp3 = inptr[48]; - - tmp10 = tmp0 + tmp2; - tmp11 = tmp0 - tmp2; - - tmp13 = tmp1 + tmp3; - tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; - - tmp0 = tmp10 + tmp13; - tmp3 = tmp10 - tmp13; - tmp1 = tmp11 + tmp12; - tmp2 = tmp11 - tmp12; - - tmp4 = inptr[8]; - tmp5 = inptr[24]; - tmp6 = inptr[40]; - tmp7 = inptr[56]; - - z13 = tmp6 + tmp5; - z10 = tmp6 - tmp5; - z11 = tmp4 + tmp7; - z12 = tmp4 - tmp7; - - tmp7 = z11 + z13; - tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); - - z5 = MULTIPLY(z10 + z12, FIX_1_847759065); - tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; - tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; - - tmp6 = tmp12 - tmp7; - tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; - - wsptr[0] = (__s32) (tmp0 + tmp7); - wsptr[56] = (__s32) (tmp0 - tmp7); - wsptr[8] = (__s32) (tmp1 + tmp6); - wsptr[48] = (__s32) (tmp1 - tmp6); - wsptr[16] = (__s32) (tmp2 + tmp5); - wsptr[40] = (__s32) (tmp2 - tmp5); - wsptr[32] = (__s32) (tmp3 + tmp4); - wsptr[24] = (__s32) (tmp3 - tmp4); - - inptr++; - wsptr++; - } - - wsptr = workspace; - for (ctr = 0; ctr < 8; ctr++) { - outptr = &(odata[ctr*rskip]); - - tmp10 = wsptr[0] + wsptr[4]; - tmp11 = wsptr[0] - wsptr[4]; - - tmp13 = wsptr[2] + wsptr[6]; - tmp12 = MULTIPLY(wsptr[2] - wsptr[6], FIX_1_414213562) - tmp13; - - tmp0 = tmp10 + tmp13; - tmp3 = tmp10 - tmp13; - tmp1 = tmp11 + tmp12; - tmp2 = tmp11 - tmp12; - - z13 = wsptr[5] + wsptr[3]; - z10 = wsptr[5] - wsptr[3]; - z11 = wsptr[1] + wsptr[7]; - z12 = wsptr[1] - wsptr[7]; - - tmp7 = z11 + z13; - tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); - - z5 = MULTIPLY(z10 + z12, FIX_1_847759065); - tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; - tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; - - tmp6 = tmp12 - tmp7; - tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; - - outptr[0] = RL(DESCALE(tmp0 + tmp7)); - outptr[7] = RL(DESCALE(tmp0 - tmp7)); - outptr[1] = RL(DESCALE(tmp1 + tmp6)); - outptr[6] = RL(DESCALE(tmp1 - tmp6)); - outptr[2] = RL(DESCALE(tmp2 + tmp5)); - outptr[5] = RL(DESCALE(tmp2 - tmp5)); - outptr[4] = RL(DESCALE(tmp3 + tmp4)); - outptr[3] = RL(DESCALE(tmp3 - tmp4)); - - wsptr += 8; - } -#endif -} /* Main Routines @@ -2754,7 +1466,6 @@ static void RTjpeg_init_Q(__u8 Q) RTjpeg_cb8--; RTjpeg_dct_init(); - RTjpeg_idct_init(); RTjpeg_quant_init(); } @@ -2816,35 +1527,6 @@ void RTjpeg_init_compress(__u32 *buf, int width, int height, __u8 Q) buf[64+i]=le2me_32(RTjpeg_ciqt[i]); } -void RTjpeg_init_decompress(__u32 *buf, int width, int height) -{ - int i; - - RTjpeg_init_data(); - - RTjpeg_width=width; - RTjpeg_height=height; - RTjpeg_Ywidth = RTjpeg_width>>3; - RTjpeg_Ysize=width * height; - RTjpeg_Cwidth = RTjpeg_width>>4; - RTjpeg_Csize= (width>>1) * height; - - for(i=0; i<64; i++) - { - RTjpeg_liqt[i]=le2me_32(buf[i]); - RTjpeg_ciqt[i]=le2me_32(buf[i+64]); - } - - RTjpeg_lb8=0; - while(RTjpeg_liqt[RTjpeg_ZZ[++RTjpeg_lb8]]<=8); - RTjpeg_lb8--; - RTjpeg_cb8=0; - while(RTjpeg_ciqt[RTjpeg_ZZ[++RTjpeg_cb8]]<=8); - RTjpeg_cb8--; - - RTjpeg_idct_init(); -} - int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) { __s8 * sb; @@ -2899,68 +1581,6 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) return (sp-sb); } -void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp) -{ - register __s8 * bp1 = bp + (RTjpeg_width<<3); - register __s8 * bp2 = bp + RTjpeg_Ysize; - register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); - int i, j,k; - -#if HAVE_MMX - emms(); -#endif - -/* Y */ - for(i=RTjpeg_height>>1; i; i-=8) - { - for(k=0, j=0; j>1); - } - if(*sp==-1)sp++; - else - { - sp+=RTjpeg_s2b(RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); - RTjpeg_idct(bp3+k, RTjpeg_block, RTjpeg_width>>1); - } - } - bp+=RTjpeg_width<<4; - bp1+=RTjpeg_width<<4; - bp2+=RTjpeg_width<<2; - bp3+=RTjpeg_width<<2; - } -#if HAVE_MMX - emms(); -#endif -} - /* External Function diff --git a/libmpcodecs/native/rtjpegn.h b/libmpcodecs/native/rtjpegn.h index 4ffcdfa39d..859b8238f8 100644 --- a/libmpcodecs/native/rtjpegn.h +++ b/libmpcodecs/native/rtjpegn.h @@ -36,9 +36,7 @@ #define __s64 int64_t void RTjpeg_init_compress(__u32 *buf, int width, int height, __u8 Q); -void RTjpeg_init_decompress(__u32 *buf, int width, int height); int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp); -void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp); void RTjpeg_init_mcompress(void); int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask); diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index b47f85357b..fa2f74ef00 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -35,7 +35,6 @@ extern vd_functions_t mpcodecs_vd_vfwex; extern vd_functions_t mpcodecs_vd_raw; extern vd_functions_t mpcodecs_vd_hmblck; extern vd_functions_t mpcodecs_vd_xanim; -extern vd_functions_t mpcodecs_vd_nuv; extern vd_functions_t mpcodecs_vd_mpng; extern vd_functions_t mpcodecs_vd_ijpg; extern vd_functions_t mpcodecs_vd_mtga; @@ -70,7 +69,6 @@ const vd_functions_t * const mpcodecs_vd_drivers[] = { &mpcodecs_vd_lzo, &mpcodecs_vd_raw, &mpcodecs_vd_hmblck, - &mpcodecs_vd_nuv, #ifdef CONFIG_XANIM &mpcodecs_vd_xanim, #endif diff --git a/libmpcodecs/vd_nuv.c b/libmpcodecs/vd_nuv.c deleted file mode 100644 index cb89ddb391..0000000000 --- a/libmpcodecs/vd_nuv.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include - -#include "config.h" -#include "mp_msg.h" - -#include "vd_internal.h" - -static vd_info_t info = { - "NuppelVideo decoder", - "nuv", - "A'rpi", - "Alex & Panagiotis Issaris ", - "native codecs" -}; - -LIBVD_EXTERN(nuv) - -// to set/get/query special features/parameters -static int control(sh_video_t *sh,int cmd,void* arg,...){ - return CONTROL_UNKNOWN; -} - -// init driver -static int init(sh_video_t *sh){ - return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_I420); -} - -// uninit driver -static void uninit(sh_video_t *sh){ -} - -//mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h); - -void decode_nuv( - unsigned char *encoded, - int encoded_size, - unsigned char *decoded, - int width, - int height); - -// decode a frame -static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ - mp_image_t* mpi; - if(len<=0) return NULL; // skipped frame - - mpi=mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, 0, - sh->disp_w, sh->disp_h); - if(!mpi) return NULL; - - decode_nuv(data, len, mpi->planes[0], sh->disp_w, sh->disp_h); - - return mpi; -} From e9f1f090e8f7c85318a2ee53c7e142a89c459c9f Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Mar 2009 13:56:35 +0000 Subject: [PATCH 27/89] rtjpegn.c is only needed by the NuppelVideo encoder, change Makefile accordingly git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28889 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 49a92e15d5..60a7b4c3a5 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,6 @@ SRCS_COMMON = asxparser.c \ libmpcodecs/dec_video.c \ libmpcodecs/img_format.c \ libmpcodecs/mp_image.c \ - libmpcodecs/native/rtjpegn.c \ libmpcodecs/native/xa_gsm.c \ libmpcodecs/pullup.c \ libmpcodecs/vd.c \ @@ -686,7 +685,7 @@ SRCS_MENCODER-$(FAAC) += libmpcodecs/ae_faac.c SRCS_MENCODER-$(LIBAVCODEC) += libmpcodecs/ae_lavc.c libmpcodecs/ve_lavc.c SRCS_MENCODER-$(LIBAVFORMAT) += libmpdemux/muxer_lavf.c SRCS_MENCODER-$(LIBDV) += libmpcodecs/ve_libdv.c -SRCS_MENCODER-$(LIBLZO) += libmpcodecs/ve_nuv.c +SRCS_MENCODER-$(LIBLZO) += libmpcodecs/ve_nuv.c libmpcodecs/native/rtjpegn.c SRCS_MENCODER-$(MP3LAME) += libmpcodecs/ae_lame.c SRCS_MENCODER-$(QTX_CODECS_WIN32) += libmpcodecs/ve_qtvideo.c SRCS_MENCODER-$(TOOLAME) += libmpcodecs/ae_toolame.c From b638947171338921f4bc7c759bc0c881c2be06fc Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 8 Mar 2009 15:20:14 +0000 Subject: [PATCH 28/89] Revert r3082 | michael | 2001-11-23 13:00:40 +0100 (Fri, 23 Nov 2001) | 2 lines missaligned arrays, as nick requested Reason: idiotic idea git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28890 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/fastmemcpybench.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TOOLS/fastmemcpybench.c b/TOOLS/fastmemcpybench.c index 2d8ac2b03d..ece7e3e4b2 100644 --- a/TOOLS/fastmemcpybench.c +++ b/TOOLS/fastmemcpybench.c @@ -105,9 +105,9 @@ int main( void ) mga_init(); marr1 = &frame[3]; #else - marr1 = &arr1[3]; + marr1 = &arr1[0]; #endif - marr2 = &arr2[9]; + marr2 = &arr2[0]; for(i=0; i Date: Sun, 8 Mar 2009 15:30:27 +0000 Subject: [PATCH 29/89] Don't assume width == stride for bitmap composition. Fixes http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1421 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28891 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index c5824322a3..b46bc9e0f5 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -423,10 +423,12 @@ static void render_overlap(ass_image_t** last_tail, ass_image_t** tail, bitmap_h int ax = (*last_tail)->dst_x; int ay = (*last_tail)->dst_y; int aw = (*last_tail)->w; + int as = (*last_tail)->stride; int ah = (*last_tail)->h; int bx = (*tail)->dst_x; int by = (*tail)->dst_y; int bw = (*tail)->w; + int bs = (*tail)->stride; int bh = (*tail)->h; unsigned char* a; unsigned char* b; @@ -472,16 +474,16 @@ static void render_overlap(ass_image_t** last_tail, ass_image_t** tail, bitmap_h // Allocate new bitmaps and copy over data a = (*last_tail)->bitmap; b = (*tail)->bitmap; - (*last_tail)->bitmap = malloc(aw*ah); - (*tail)->bitmap = malloc(bw*bh); - memcpy((*last_tail)->bitmap, a, aw*ah); - memcpy((*tail)->bitmap, b, bw*bh); + (*last_tail)->bitmap = malloc(as*ah); + (*tail)->bitmap = malloc(bs*bh); + memcpy((*last_tail)->bitmap, a, as*ah); + memcpy((*tail)->bitmap, b, bs*bh); // Composite overlapping area for (y=0; y b[cpos]) ? a[opos] : b[cpos]; (*last_tail)->bitmap[opos] = 0; (*tail)->bitmap[cpos] = m; From 2a70f019e97ac9d1cbbb9f30ddf44a593e446b24 Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 8 Mar 2009 15:30:40 +0000 Subject: [PATCH 30/89] Remove extraneous braces. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28892 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index b46bc9e0f5..dec08e519d 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -446,12 +446,12 @@ static void render_overlap(ass_image_t** last_tail, ass_image_t** tail, bitmap_h bottom = ((ay+ah) < (by+bh)) ? (ay+ah) : (by+bh); if ((right <= left) || (bottom <= top)) return; - old_left = left-(ax); - old_top = top-(ay); + old_left = left-ax; + old_top = top-ay; w = right-left; h = bottom-top; - cur_left = left-(bx); - cur_top = top-(by); + cur_left = left-bx; + cur_top = top-by; // Query cache memcpy(&hk.a, last_hash, sizeof(*last_hash)); From 1a493bf6a845f3a45bbc55366171fe7176b8939c Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 8 Mar 2009 15:43:52 +0000 Subject: [PATCH 31/89] Resurrect script needed for easy use of fastmemcpybench.c. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28893 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/fastmem.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 TOOLS/fastmem.sh diff --git a/TOOLS/fastmem.sh b/TOOLS/fastmem.sh new file mode 100755 index 0000000000..fca5e8b344 --- /dev/null +++ b/TOOLS/fastmem.sh @@ -0,0 +1,19 @@ + +sync +sleep 2 +./fastmem-k6 +sleep 2 +./fastmem-k7 +sleep 2 +./fastmem-mmx +sleep 2 +./fastmem-sse +sleep 2 +./fastmem2-k6 +sleep 2 +./fastmem2-k7 +sleep 2 +./fastmem2-mmx +sleep 2 +./fastmem2-sse +sleep 2 From 1f612555888ae906248cad0fad70667adce1c58f Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 8 Mar 2009 15:56:20 +0000 Subject: [PATCH 32/89] Add test for C memcpy() git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28894 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 1 + TOOLS/fastmem.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 60a7b4c3a5..34e3618d17 100644 --- a/Makefile +++ b/Makefile @@ -1018,6 +1018,7 @@ TOOLS/netstream$(EXESUF) TOOLS/vivodump$(EXESUF): $(subst mplayer.o,mplayer-noma $(CC) $(CFLAGS) -o $@ $^ $(EXTRALIBS_MPLAYER) $(EXTRALIBS_MENCODER) $(COMMON_LDFLAGS) fastmemcpybench: TOOLS/fastmemcpybench.c + $(CC) $(CFLAGS) $< -o TOOLS/fastmem-c$(EXESUF) -DNAME=\"c\" $(CC) $(CFLAGS) $< -o TOOLS/fastmem-mmx$(EXESUF) -DNAME=\"mmx\" -DHAVE_MMX $(CC) $(CFLAGS) $< -o TOOLS/fastmem-k6$(EXESUF) -DNAME=\"k6\ \" -DHAVE_MMX -DHAVE_AMD3DNOW $(CC) $(CFLAGS) $< -o TOOLS/fastmem-k7$(EXESUF) -DNAME=\"k7\ \" -DHAVE_MMX -DHAVE_AMD3DNOW -DHAVE_MMX2 diff --git a/TOOLS/fastmem.sh b/TOOLS/fastmem.sh index fca5e8b344..1b8ff12793 100755 --- a/TOOLS/fastmem.sh +++ b/TOOLS/fastmem.sh @@ -9,6 +9,8 @@ sleep 2 sleep 2 ./fastmem-sse sleep 2 +./fastmem-c +sleep 2 ./fastmem2-k6 sleep 2 ./fastmem2-k7 From 686d57168f91e7314a0dc7a3ce95a905e83e49dc Mon Sep 17 00:00:00 2001 From: eugeni Date: Sun, 8 Mar 2009 16:13:21 +0000 Subject: [PATCH 33/89] Treat -font/-subfont as Fontconfig pattern in libass. Patch by Adrian Stutz (adrian sttz ch). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28895 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 10 ++++++---- libass/ass_cache.c | 2 ++ libass/ass_font.c | 3 ++- libass/ass_font.h | 1 + libass/ass_fontconfig.c | 31 ++++++++++++++++++++----------- libass/ass_fontconfig.h | 2 +- libass/ass_mp.c | 1 + libass/ass_render.c | 3 +++ libass/ass_types.h | 1 + 9 files changed, 37 insertions(+), 17 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index dcb4214859..a66134e513 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -2253,14 +2253,14 @@ Use this if commas in subtitles are shown at the start of a sentence instead of at the end. . .TP -.B \-font +.B \-font Search for the OSD/\:SUB fonts in an alternative directory (default for normal fonts: ~/\:.mplayer/\:font/\:font.desc, default for FreeType fonts: ~/.mplayer/\:subfont.ttf). .br .I NOTE: With FreeType, this option determines the path to the text font file. -With fontconfig, this option determines the fontconfig font name. +With Fontconfig, this option determines the Fontconfig font pattern. .sp 1 .I EXAMPLE: .PD 0 @@ -2270,6 +2270,8 @@ With fontconfig, this option determines the fontconfig font name. \-font ~/\:.mplayer/\:arialuni.ttf .br \-font 'Bitstream Vera Sans' +.br +\-font 'Bitstream Vera Sans:style=Bold' .RE .PD 1 . @@ -2508,8 +2510,8 @@ Currently useless. Same as \-audiofile, but for subtitle streams (OggDS?). . .TP -.B \-subfont (FreeType only) -Sets the subtitle font. +.B \-subfont (FreeType only) +Sets the subtitle font (see \-font). If no \-subfont is given, \-font is used. . .TP diff --git a/libass/ass_cache.c b/libass/ass_cache.c index 0561874606..3b90e66e4c 100644 --- a/libass/ass_cache.c +++ b/libass/ass_cache.c @@ -192,6 +192,8 @@ static int font_compare(void* key1, void* key2, size_t key_size) { return 0; if (a->italic != b->italic) return 0; + if (a->treat_family_as_pattern != b->treat_family_as_pattern) + return 0; return 1; } diff --git a/libass/ass_font.c b/libass/ass_font.c index f2214a345d..579e658f14 100644 --- a/libass/ass_font.c +++ b/libass/ass_font.c @@ -125,7 +125,7 @@ static int add_face(void* fc_priv, ass_font_t* font, uint32_t ch) if (font->n_faces == ASS_FONT_MAX_FACES) return -1; - path = fontconfig_select(fc_priv, font->desc.family, font->desc.bold, + path = fontconfig_select(fc_priv, font->desc.family, font->desc.treat_family_as_pattern, font->desc.bold, font->desc.italic, &index, ch); mem_idx = find_font(font->library, path); @@ -169,6 +169,7 @@ ass_font_t* ass_font_new(ass_library_t* library, FT_Library ftlibrary, void* fc_ font.ftlibrary = ftlibrary; font.n_faces = 0; font.desc.family = strdup(desc->family); + font.desc.treat_family_as_pattern = desc->treat_family_as_pattern; font.desc.bold = desc->bold; font.desc.italic = desc->italic; diff --git a/libass/ass_font.h b/libass/ass_font.h index 03396a6f21..520431821b 100644 --- a/libass/ass_font.h +++ b/libass/ass_font.h @@ -33,6 +33,7 @@ typedef struct ass_font_desc_s { char* family; unsigned bold; unsigned italic; + int treat_family_as_pattern; } ass_font_desc_t; #define ASS_FONT_MAX_FACES 10 diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c index 9a7bddecc4..9bdca86f31 100644 --- a/libass/ass_fontconfig.c +++ b/libass/ass_fontconfig.c @@ -66,14 +66,15 @@ struct fc_instance_s { * \brief Low-level font selection. * \param priv private data * \param family font family + * \param treat_family_as_pattern treat family as fontconfig pattern * \param bold font weight value * \param italic font slant value * \param index out: font index inside a file * \param code: the character that should be present in the font, can be 0 * \return font file path */ -static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold, unsigned italic, int* index, - uint32_t code) +static char* _select_font(fc_instance_t* priv, const char* family, int treat_family_as_pattern, + unsigned bold, unsigned italic, int* index, uint32_t code) { FcBool rc; FcResult result; @@ -89,10 +90,15 @@ static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold *index = 0; - pat = FcPatternCreate(); + if (treat_family_as_pattern) + pat = FcNameParse((const FcChar8*)family); + else + pat = FcPatternCreate(); + if (!pat) goto error; + if (!treat_family_as_pattern) { FcPatternAddString(pat, FC_FAMILY, (const FcChar8*)family); // In SSA/ASS fonts are sometimes referenced by their "full name", @@ -118,6 +124,7 @@ static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold } free(s); } + } FcPatternAddBool(pat, FC_OUTLINE, FcTrue); FcPatternAddInteger(pat, FC_SLANT, italic); FcPatternAddInteger(pat, FC_WEIGHT, bold); @@ -182,7 +189,8 @@ static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold if (result != FcResultMatch) r_fullname = NULL; - if (!(r_family && strcasecmp((const char*)r_family, family) == 0) && + if (!treat_family_as_pattern && + !(r_family && strcasecmp((const char*)r_family, family) == 0) && !(r_fullname && strcasecmp((const char*)r_fullname, family) == 0)) mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_SelectedFontFamilyIsNotTheRequestedOne, (const char*)(r_fullname ? r_fullname : r_family), family); @@ -219,14 +227,15 @@ static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold * \brief Find a font. Use default family or path if necessary. * \param priv_ private data * \param family font family + * \param treat_family_as_pattern treat family as fontconfig pattern * \param bold font weight value * \param italic font slant value * \param index out: font index inside a file * \param code: the character that should be present in the font, can be 0 * \return font file path */ -char* fontconfig_select(fc_instance_t* priv, const char* family, unsigned bold, unsigned italic, int* index, - uint32_t code) +char* fontconfig_select(fc_instance_t* priv, const char* family, int treat_family_as_pattern, + unsigned bold, unsigned italic, int* index, uint32_t code) { char* res = 0; if (!priv->config) { @@ -234,9 +243,9 @@ char* fontconfig_select(fc_instance_t* priv, const char* family, unsigned bold, return priv->path_default; } if (family && *family) - res = _select_font(priv, family, bold, italic, index, code); + res = _select_font(priv, family, treat_family_as_pattern, bold, italic, index, code); if (!res && priv->family_default) { - res = _select_font(priv, priv->family_default, bold, italic, index, code); + res = _select_font(priv, priv->family_default, 0, bold, italic, index, code); if (res) mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_UsingDefaultFontFamily, family, bold, italic, res, *index); @@ -248,7 +257,7 @@ char* fontconfig_select(fc_instance_t* priv, const char* family, unsigned bold, family, bold, italic, res, *index); } if (!res) { - res = _select_font(priv, "Arial", bold, italic, index, code); + res = _select_font(priv, "Arial", 0, bold, italic, index, code); if (res) mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_UsingArialFontFamily, family, bold, italic, res, *index); @@ -474,8 +483,8 @@ exit: #else /* CONFIG_FONTCONFIG */ -char* fontconfig_select(fc_instance_t* priv, const char* family, unsigned bold, unsigned italic, int* index, - uint32_t code) +char* fontconfig_select(fc_instance_t* priv, const char* family, int treat_family_as_pattern, + unsigned bold, unsigned italic, int* index, uint32_t code) { *index = priv->index_default; return priv->path_default; diff --git a/libass/ass_fontconfig.h b/libass/ass_fontconfig.h index e9a1ce1567..77806909cf 100644 --- a/libass/ass_fontconfig.h +++ b/libass/ass_fontconfig.h @@ -35,7 +35,7 @@ typedef struct fc_instance_s fc_instance_t; fc_instance_t* fontconfig_init(ass_library_t* library, FT_Library ftlibrary, const char* family, const char* path, int fc); -char* fontconfig_select(fc_instance_t* priv, const char* family, unsigned bold, unsigned italic, int* index, uint32_t code); +char* fontconfig_select(fc_instance_t* priv, const char* family, int treat_family_as_pattern, unsigned bold, unsigned italic, int* index, uint32_t code); void fontconfig_done(fc_instance_t* priv); #endif /* LIBASS_FONTCONFIG_H */ diff --git a/libass/ass_mp.c b/libass/ass_mp.c index 40da63c348..7e25b8e316 100644 --- a/libass/ass_mp.c +++ b/libass/ass_mp.c @@ -94,6 +94,7 @@ ass_track_t* ass_default_track(ass_library_t* library) { style = track->styles + sid; style->Name = strdup("Default"); style->FontName = (font_fontconfig >= 0 && sub_font_name) ? strdup(sub_font_name) : (font_fontconfig >= 0 && font_name) ? strdup(font_name) : strdup("Sans"); + style->treat_fontname_as_pattern = 1; fs = track->PlayResY * text_font_scale_factor / 100.; // approximate autoscale coefficients diff --git a/libass/ass_render.c b/libass/ass_render.c index dec08e519d..b561b2a82a 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -184,6 +184,7 @@ typedef struct render_context_s { char* family; unsigned bold; unsigned italic; + int treat_family_as_pattern; } render_context_t; @@ -676,6 +677,7 @@ static void update_font(void) ass_renderer_t* priv = frame_context.ass_priv; ass_font_desc_t desc; desc.family = strdup(render_context.family); + desc.treat_family_as_pattern = render_context.treat_family_as_pattern; val = render_context.bold; // 0 = normal, 1 = bold, >1 = exact weight @@ -1359,6 +1361,7 @@ static void reset_render_context(void) if (render_context.family) free(render_context.family); render_context.family = strdup(render_context.style->FontName); + render_context.treat_family_as_pattern = render_context.style->treat_fontname_as_pattern; render_context.bold = render_context.style->Bold; render_context.italic = render_context.style->Italic; update_font(); diff --git a/libass/ass_types.h b/libass/ass_types.h index 52aff0fb85..01c36c5748 100644 --- a/libass/ass_types.h +++ b/libass/ass_types.h @@ -58,6 +58,7 @@ typedef struct ass_style_s { int MarginV; // int AlphaLevel; int Encoding; + int treat_fontname_as_pattern; } ass_style_t; typedef struct render_priv_s render_priv_t; From 79b915673295129c39848765b06972136c82b607 Mon Sep 17 00:00:00 2001 From: eugeni Date: Sun, 8 Mar 2009 16:13:26 +0000 Subject: [PATCH 34/89] Cosmetics: reindent. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28896 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_fontconfig.c | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c index 9bdca86f31..d0042dcdfd 100644 --- a/libass/ass_fontconfig.c +++ b/libass/ass_fontconfig.c @@ -99,31 +99,31 @@ static char* _select_font(fc_instance_t* priv, const char* family, int treat_fam goto error; if (!treat_family_as_pattern) { - FcPatternAddString(pat, FC_FAMILY, (const FcChar8*)family); + FcPatternAddString(pat, FC_FAMILY, (const FcChar8*)family); - // In SSA/ASS fonts are sometimes referenced by their "full name", - // which is usually a concatenation of family name and font - // style (ex. Ottawa Bold). Full name is available from - // FontConfig pattern element FC_FULLNAME, but it is never - // used for font matching. - // Therefore, I'm removing words from the end of the name one - // by one, and adding shortened names to the pattern. It seems - // that the first value (full name in this case) has - // precedence in matching. - // An alternative approach could be to reimplement FcFontSort - // using FC_FULLNAME instead of FC_FAMILY. - family_cnt = 1; - { - char* s = strdup(family); - char* p = s + strlen(s); - while (--p > s) - if (*p == ' ' || *p == '-') { - *p = '\0'; - FcPatternAddString(pat, FC_FAMILY, (const FcChar8*)s); - ++ family_cnt; - } - free(s); - } + // In SSA/ASS fonts are sometimes referenced by their "full name", + // which is usually a concatenation of family name and font + // style (ex. Ottawa Bold). Full name is available from + // FontConfig pattern element FC_FULLNAME, but it is never + // used for font matching. + // Therefore, I'm removing words from the end of the name one + // by one, and adding shortened names to the pattern. It seems + // that the first value (full name in this case) has + // precedence in matching. + // An alternative approach could be to reimplement FcFontSort + // using FC_FULLNAME instead of FC_FAMILY. + family_cnt = 1; + { + char* s = strdup(family); + char* p = s + strlen(s); + while (--p > s) + if (*p == ' ' || *p == '-') { + *p = '\0'; + FcPatternAddString(pat, FC_FAMILY, (const FcChar8*)s); + ++ family_cnt; + } + free(s); + } } FcPatternAddBool(pat, FC_OUTLINE, FcTrue); FcPatternAddInteger(pat, FC_SLANT, italic); From 1e3f85d23e2004a3d5aacd08633d19eb9a2ae348 Mon Sep 17 00:00:00 2001 From: bircoph Date: Sun, 8 Mar 2009 17:49:34 +0000 Subject: [PATCH 35/89] Synced with r28895. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28897 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/ru/mplayer.1 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/DOCS/man/ru/mplayer.1 b/DOCS/man/ru/mplayer.1 index bc062259b8..a47e8a5eac 100644 --- a/DOCS/man/ru/mplayer.1 +++ b/DOCS/man/ru/mplayer.1 @@ -2,7 +2,7 @@ .\" This man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann .\" Translated by Vladimir Voroshilov .\" Encoding: koi8-r -.\" synced with r28807 +.\" synced with r28895 . .\" -------------------------------------------------------------------------- .\" ïÐÒÅÄÅÌÅÎÉÑ ÍÁËÒÏÓÏ× @@ -922,6 +922,8 @@ mplayer \-heartbeat\-cmd "gnome\-screensaver\-command \-p" file úÁÄÅÒÖËÁ × ÍÉÌÌÉÓÅËÕÎÄÁÈ ÐÅÒÅÄ ÎÁÞÁÌÏÍ Á×ÔÏÐÏ×ÔÏÒÁ (0 ÄÌÑ ÏÔËÌÀÞÅÎÉÑ). .IPs ar\-rate ëÏÌÉÞÅÓÔ×Ï ËÌÁ×ÉÛ × ÓÅËÕÎÄÕ, ÇÅÎÅÒÉÒÕÅÍÙÈ ÐÒÉ Á×ÔÏÐÏ×ÔÏÒÅ. +.IPs (no)default-binds +éÓÐÏÌØÚÏ×ÁÔØ ÐÒÉ×ÑÚËÉ ËÌÁ×ÉÛ, ÐÏÓÔÁ×ÌÑÅÍÙÅ Ó MPlayer ÐÏ ÕÍÏÌÞÁÎÉÀ. .IPs keylist ÷Ù×ÏÄÉÔ ×ÓÅ ËÌÁ×ÉÛÉ, ËÏÔÏÒÙÅ ÍÏÖÎÏ ÎÁÚÎÁÞÉÔØ ËÏÍÁÎÄÁÍ. .IPs cmdlist @@ -1085,17 +1087,18 @@ FIXME: . .TP .B \-slave (ÓÍÏÔÒÉÔÅ ÔÁËÖÅ \-input) -÷ËÌÀÞÁÅÔ "ÒÁÂÓËÉÊ" ÒÅÖÉÍ, × ËÏÔÏÒÏÍ MPlayer ÒÁÂÏÔÁÅÔ × ËÁÞÅÓÔ×Å ÂÜËÜÎÄÁ Ë ÄÒÕÇÉÍ ÐÒÏÇÒÁÍÍÁÍ. +÷ËÌÀÞÁÅÔ ×ÅÄÏÍÙÊ ÒÅÖÉÍ, × ËÏÔÏÒÏÍ MPlayer ÒÁÂÏÔÁÅÔ × ËÁÞÅÓÔ×Å ÂÜËÜÎÄÁ Ë ÄÒÕÇÉÍ ÐÒÏÇÒÁÍÍÁÍ. ÷ÍÅÓÔÏ ÐÅÒÅÈ×ÁÔÁ ÓÏÂÙÔÉÊ ËÌÁ×ÉÁÔÕÒÙ, MPlayer ÂÕÄÅÔ ÞÉÔÁÔØ ÓÏ ÓÔÁÎÄÁÒÔÎÏÇÏ ×ÈÏÄÁ ËÏÍÁÎÄÙ, ÒÁÚÄÅÌÅÎÎÙÅ ÓÉÍ×ÏÌÏÍ ÎÏ×ÏÊ ÓÔÒÏËÉ (\\n). .br .I úáíåþáîéå: óÍÏÔÒÉÔÅ ÓÐÉÓÏË ÜÔÉÈ ËÏÍÁÎÄ × \-input cmdlist É ÏÐÉÓÁÎÉÑ × DOCS/tech/slave.txt. +üÔÁ ÏÐÃÉÑ ÎÅ ÐÒÅÄÎÁÚÎÁÞÅÎÁ ÄÌÑ ÏÔËÌÀÞÅÎÉÑ ÄÒÕÇÉÈ ÉÓÔÏÞÎÉËÏ× ××ÏÄÁ, +ÎÁÐÒÉÍÅÒ ÐÒÉ ÐÏÍÏÝÉ ÏËÎÁ ×ÉÄÅÏ; ÄÌÑ ÄÁÎÎÙÈ ÃÅÌÅÊ ÉÓÐÏÌØÚÕÊÔÅ ÉÎÙÅ +ÓÐÏÓÏÂÙ, ÎÁÐÒÉÍÅÒ, \-input nodefault\-binds:conf=/dev/null. . .TP .B \-softsleep -.\" FIXME is translation correct? -.\" Time frames by repeatedly checking the current time instead of asking the õÓÔÁÎÁ×ÌÉ×ÁÅÔ ÔÁÊÍÉÎÇ ËÁÄÒÏ×, ÐÏÓÔÏÑÎÎÏ ÐÒÏ×ÅÒÑÑ ÔÅËÕÝÅÅ ×ÒÅÍÑ, ×ÍÅÓÔÏ ÐÒÏÓØÂÙ ÑÄÒÕ ÐÒÏÂÕÖÄÁÔØ MPlayer × ÎÕÖÎÙÊ ÍÏÍÅÎÔ. ðÏÌÅÚÎÏ, ÅÓÌÉ ÔÁÊÍÅÒ ×ÁÛÅÇÏ ÑÄÒÁ ÎÅÔÏÞÅÎ É ×Ù ÎÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ RTC. @@ -2217,14 +2220,14 @@ SubViewer (SRT). ×ÍÅÓÔÏ ÉÈ ËÏÎÃÁ. . .TP -.B \-font <ÐÕÔØ Ë ÆÁÊÌÕ font.desc> +.B \-font <ÐÕÔØ Ë ÆÁÊÌÕ font.desc, ÐÕÔØ Ë ÛÒÉÆÔÕ (FreeType), ÎÁÚ×ÁÎÉÅ ÛÒÉÆÔÁ (Fontconfig))> éÝÅÔ OSD/\:SUB ÛÒÉÆÔÙ × ÄÒÕÇÏÍ ËÁÔÁÌÏÇÅ (ÐÏ ÕÍÏÌÞÁÎÉÀ ÄÌÑ ÏÂÙÞÎÙÈ ÛÒÉÆÔÏ×: ~/\:.mplayer/\:font/\:font.desc, ÐÏ ÕÍÏÌÞÁÎÉÀ ÄÌÑ FreeType ÛÒÉÆÔÏ×: ~/.mplayer/\:subfont.ttf). .br .I úáíåþáîéå: ó FreeType, ÜÔÁ ÏÐÃÉÑ ÏÐÒÅÄÅÌÑÅÔ ÐÕÔØ Ë ÆÁÊÌÕ ÛÒÉÆÔÁ ÔÅËÓÔÁ. -ó fontconfig, ÜÔÁ ÏÐÃÉÑ ÏÐÒÅÄÅÌÑÅÔ ÎÁÚ×ÁÎÉÅ ÛÒÉÆÔÁ fontconfig. +ó Fontconfig, ÜÔÁ ÏÐÃÉÑ ÏÐÒÅÄÅÌÑÅÔ ÎÁÚ×ÁÎÉÅ ÛÒÉÆÔÁ fontconfig. .sp 1 .I ðòéíåò: .PD 0 @@ -2234,6 +2237,8 @@ SubViewer (SRT). \-font ~/\:.mplayer/\:arialuni.ttf .br \-font 'Bitstream Vera Sans' +.br +\-font 'Bitstream Vera Sans:style=Bold' .RE .PD 1 . @@ -2475,8 +2480,8 @@ cp1250, ôÏ ÖÅ, ÞÔÏ É \-audiofile, ÎÏ ÄÌÑ ÐÏÔÏËÁ ÓÕÂÔÉÔÒÏ× (OggDS?). . .TP -.B \-subfont <ÉÍÑ ÆÁÊÌÁ> (ÔÏÌØËÏ FreeType) -õÓÔÁÎÁ×ÌÉ×ÁÅÔ ÛÒÉÆÔ ÓÕÂÔÉÔÒÏ×. +.B \-subfont <ÉÍÑ ÆÁÊÌÁ (FreeType), ÎÁÚ×ÁÎÉÅ ÛÒÉÆÔÁ (Fontconfig)> (ÔÏÌØËÏ FreeType) +õÓÔÁÎÁ×ÌÉ×ÁÅÔ ÛÒÉÆÔ ÓÕÂÔÉÔÒÏ× (ÓÍ. \-font). åÓÌÉ ÏÐÃÉÑ \-subfont ÎÅ ÕËÁÚÁÎÁ, ÉÓÐÏÌØÚÕÅÔÓÑ \-font. . .TP From 0500783b366223fcb8b2e1e82ba74d1d9c91957f Mon Sep 17 00:00:00 2001 From: gpoirier Date: Sun, 8 Mar 2009 20:27:31 +0000 Subject: [PATCH 36/89] sync w/r28895 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28898 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/fr/mplayer.1 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1 index 0052962c64..495581b57d 100644 --- a/DOCS/man/fr/mplayer.1 +++ b/DOCS/man/fr/mplayer.1 @@ -1,4 +1,4 @@ -.\" synced with r28807 +.\" synced with r28895 .\" Encoding: iso-8859-1 .\" MPlayer (C) 2000-2009 MPlayer Team .\" The English man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann @@ -1009,6 +1009,8 @@ d'une touche (0 pour désactiver). .IPs ar-rate Combien de frappes par seconde pendant la répétition automatique. +.IPs (no)default-binds +Répond aux touches de contrôle par défaut de MPlayer. .IPs keylist Affiche toutes les touches pouvant être attachées. .IPs cmdlist @@ -1193,6 +1195,9 @@ commandes s .I NOTE\ : Voir \-input cmdlist pour une liste des commandes esclaves, et DOCS/tech/slave.txt pour leur description. +De plus, cette option n'est pas vouée à désactiver les autres entrées, +comme via la fenêtre vidéo\ ; pour cela, utilisez d'autres méthodes, comme +\-input nodefault\-binds:conf=/dev/null. . .TP .B \-softsleep @@ -2354,14 +2359,14 @@ les sous-titres. phrases au lieu de la fin. . .TP -.B \-font +.B \-font Recherche les polices OSD/\:SUB dans un répertoire particulier (par défaut pour les polices normales: ~/\:.mplayer/\:font/\:font.desc, pour les polices FreeType: ~/.mplayer/\:subfont.ttf). .br .I NOTE: Avec FreeType, cette option détermine le chemin vers le fichier de polices. -Avec Fontconfig, cette option détermine le nom de police fontconfig. +Avec Fontconfig, cette option détermine le motif de police Fontconfig. .sp 1 .I EXEMPLE: .PD 0 @@ -2370,7 +2375,9 @@ Avec Fontconfig, cette option d .br \-font ~/\:.mplayer/\:arialuni.ttf .br -\-font 'Bitstream Vera Sans' +\-font 'Bitstream Vera Sans:style' +.br +\-font 'Bitstream Vera Sans:style=Bold' .RE .PD 1 . @@ -2615,8 +2622,8 @@ Inutile actuellement. Identique à \-audiofile, mais pour les flux de sous-titres (OggDS ?). . .TP -.B \-subfont (FreeType uniquement) -Spécifie la police des sous-titres. +.B \-subfont (FreeType uniquement) +Spécifie la police des sous-titres (voir \-font). Si \-subfont n'est pas spécifié, \-font est utilisé. . .TP From 15b605c6909f668abaf937ff9588defd5714101e Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 9 Mar 2009 00:48:03 +0000 Subject: [PATCH 37/89] Fix fastmemcpybench tools build: - HAVE_MMX and friends now have 0/1 values and are always defined. - Use proper file dependencies instead of a phony target. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28899 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 34e3618d17..2822754600 100644 --- a/Makefile +++ b/Makefile @@ -1000,7 +1000,7 @@ alltools: $(addsuffix $(EXESUF),$(ALLTOOLS)) toolsclean: -rm -f $(foreach file,$(ALLTOOLS),$(call ADD_ALL_EXESUFS,$(file))) - -rm -f TOOLS/fastmem*-* TOOLS/realcodecs/*.so.6.0 + -rm -f TOOLS/fastmem-* TOOLS/realcodecs/*.so.6.0 TOOLS/bmovl-test$(EXESUF): -lSDL_image @@ -1017,16 +1017,20 @@ TOOLS/vivodump$(EXESUF): TOOLS/vivodump.c TOOLS/netstream$(EXESUF) TOOLS/vivodump$(EXESUF): $(subst mplayer.o,mplayer-nomain.o,$(OBJS_MPLAYER)) $(filter-out %mencoder.o,$(OBJS_MENCODER)) $(OBJS_COMMON) $(COMMON_LIBS) $(CC) $(CFLAGS) -o $@ $^ $(EXTRALIBS_MPLAYER) $(EXTRALIBS_MENCODER) $(COMMON_LDFLAGS) -fastmemcpybench: TOOLS/fastmemcpybench.c - $(CC) $(CFLAGS) $< -o TOOLS/fastmem-c$(EXESUF) -DNAME=\"c\" - $(CC) $(CFLAGS) $< -o TOOLS/fastmem-mmx$(EXESUF) -DNAME=\"mmx\" -DHAVE_MMX - $(CC) $(CFLAGS) $< -o TOOLS/fastmem-k6$(EXESUF) -DNAME=\"k6\ \" -DHAVE_MMX -DHAVE_AMD3DNOW - $(CC) $(CFLAGS) $< -o TOOLS/fastmem-k7$(EXESUF) -DNAME=\"k7\ \" -DHAVE_MMX -DHAVE_AMD3DNOW -DHAVE_MMX2 - $(CC) $(CFLAGS) $< -o TOOLS/fastmem-sse$(EXESUF) -DNAME=\"sse\" -DHAVE_MMX -DHAVE_SSE -DHAVE_MMX2 - $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-mmx$(EXESUF) -DNAME=\"mga-mmx\" -DCONFIG_MGA -DHAVE_MMX - $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-k6$(EXESUF) -DNAME=\"mga-k6\ \" -DCONFIG_MGA -DHAVE_MMX -DHAVE_AMD3DNOW - $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-k7$(EXESUF) -DNAME=\"mga-k7\ \" -DCONFIG_MGA -DHAVE_MMX -DHAVE_AMD3DNOW -DHAVE_MMX2 - $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-sse$(EXESUF) -DNAME=\"mga-sse\" -DCONFIG_MGA -DHAVE_MMX -DHAVE_SSE -DHAVE_MMX2 +TOOLS/fastmem-c$(EXESUF): CFLAGS += -DHAVE_MMX=0 -DHAVE_AMD3DNOW=0 -DHAVE_MMX2=0 -DHAVE_SSE=0 -DNAME=\"C\" +TOOLS/fastmem-mmx$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=0 -DHAVE_MMX2=0 -DHAVE_SSE=0 -DNAME=\"MMX\" +TOOLS/fastmem-k6$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=1 -DHAVE_MMX2=0 -DHAVE_SSE=0 -DNAME=\"K6\" +TOOLS/fastmem-k7$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=1 -DHAVE_MMX2=1 -DHAVE_SSE=0 -DNAME=\"K7\" +TOOLS/fastmem-sse$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=0 -DHAVE_MMX2=1 -DHAVE_SSE=1 -DNAME=\"SSE\" +TOOLS/fastmem-mga-mmx$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=0 -DHAVE_MMX2=0 -DHAVE_SSE=0 -DNAME=\"MGA-MMX\" -DCONFIG_MGA +TOOLS/fastmem-mga-k6$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=1 -DHAVE_MMX2=0 -DHAVE_SSE=0 -DNAME=\"MGA-K6\" -DCONFIG_MGA +TOOLS/fastmem-mga-k7$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=1 -DHAVE_MMX2=1 -DHAVE_SSE=0 -DNAME=\"MGA-K7\" -DCONFIG_MGA +TOOLS/fastmem-mga-sse$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=0 -DHAVE_MMX2=1 -DHAVE_SSE=1 -DNAME=\"MGA-SSE\" -DCONFIG_MGA + +fastmemcpybench: $(addsuffix $(EXESUF),$(addprefix TOOLS/fastmem-,c mmx k6 k7 sse mga-mmx mga-k6 mga-k7 mga-sse)) + +TOOLS/fastmem-%$(EXESUF): TOOLS/fastmemcpybench.c + $(CC) $(CFLAGS) -o $@ $< REAL_SRCS = $(wildcard TOOLS/realcodecs/*.c) REAL_TARGETS = $(REAL_SRCS:.c=.so.6.0) From 708819105f20bbe4e608045e13e1f025352d7def Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 9 Mar 2009 01:48:42 +0000 Subject: [PATCH 38/89] Change default OSD/subtitle font sizes. This was discussed on -dev-eng and IRC. The consensus seems to be that 3-4% of the diagonal is a good default, and most people use something along these lines. The subtitle font size is set to 3.5% and the OSD is kept a little bigger with 4%. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28900 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/font_load_ft.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index ddb6af5ada..20d673a0fc 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -56,8 +56,8 @@ #endif char *subtitle_font_encoding = NULL; -float text_font_scale_factor = 5.0; -float osd_font_scale_factor = 6.0; +float text_font_scale_factor = 3.5; +float osd_font_scale_factor = 4.0; float subtitle_font_radius = 2.0; float subtitle_font_thickness = 2.0; // 0 = no autoscale From 1753d37fc714f2eb387689140016908845d5af3f Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 9 Mar 2009 11:02:54 +0000 Subject: [PATCH 40/89] Merge two preprocessor conditions in order to drop one duplicated #else case. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28902 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/fastmemcpy.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libvo/fastmemcpy.h b/libvo/fastmemcpy.h index fa736b62f0..16767d9842 100644 --- a/libvo/fastmemcpy.h +++ b/libvo/fastmemcpy.h @@ -23,20 +23,13 @@ #include #include -#ifdef CONFIG_FASTMEMCPY -#if HAVE_MMX || HAVE_MMX2 || HAVE_AMD3DNOW \ -/* || HAVE_SSE || HAVE_SSE2 */ +#if defined(CONFIG_FASTMEMCPY) && (HAVE_MMX || HAVE_MMX2 || HAVE_AMD3DNOW /* || HAVE_SSE || HAVE_SSE2 */) #include void * fast_memcpy(void * to, const void * from, size_t len); void * mem2agpcpy(void * to, const void * from, size_t len); -#else /* HAVE_MMX/MMX2/3DNOW/SSE/SSE2 */ -#define mem2agpcpy(a,b,c) memcpy(a,b,c) -#define fast_memcpy(a,b,c) memcpy(a,b,c) -#endif - -#else /* CONFIG_FASTMEMCPY */ +#else #define mem2agpcpy(a,b,c) memcpy(a,b,c) #define fast_memcpy(a,b,c) memcpy(a,b,c) #endif From a0bce02b7c29bba8a4a69dff1f61e80e1d2ad979 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 9 Mar 2009 11:28:31 +0000 Subject: [PATCH 41/89] whitespace cosmetics: - Remove all tabs and trailing whitespace. - Indent with 4 spaces. - K&R-ify and prettyprint some parts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28903 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/fastmemcpybench.c | 137 ++++++++++++++++++++-------------------- 1 file changed, 69 insertions(+), 68 deletions(-) diff --git a/TOOLS/fastmemcpybench.c b/TOOLS/fastmemcpybench.c index ece7e3e4b2..66bb1671c5 100644 --- a/TOOLS/fastmemcpybench.c +++ b/TOOLS/fastmemcpybench.c @@ -1,6 +1,6 @@ /* fastmemcpybench.c used to benchmark fastmemcpy.h code from libvo. - + Note: this code can not be used on PentMMX-PII because they contain a bug in rdtsc. For Intel processors since P6(PII) rdpmc should be used instead. For PIII it's disputable and seems bug was fixed but I don't @@ -27,50 +27,48 @@ #include "drivers/mga_vid.h" static mga_vid_config_t mga_vid_config; -static unsigned char* frame=NULL; +static unsigned char* frame = NULL; static int f; static int mga_init(void) { - f = open("/dev/mga_vid",O_RDWR); - if(f == -1) - { - fprintf(stderr,"Couldn't open /dev/mga_vid\n"); - return -1; - } + f = open("/dev/mga_vid", O_RDWR); + if (f == -1) { + fprintf(stderr, "Couldn't open /dev/mga_vid\n"); + return -1; + } - mga_vid_config.num_frames=1; - mga_vid_config.frame_size=ARR_SIZE; - mga_vid_config.format=MGA_VID_FORMAT_YUY2; + mga_vid_config.num_frames = 1; + mga_vid_config.frame_size = ARR_SIZE; + mga_vid_config.format = MGA_VID_FORMAT_YUY2; - mga_vid_config.colkey_on=0; - mga_vid_config.src_width = 640; - mga_vid_config.src_height= 480; - mga_vid_config.dest_width = 320; - mga_vid_config.dest_height= 200; - mga_vid_config.x_org= 0; - mga_vid_config.y_org= 0; - - mga_vid_config.version=MGA_VID_VERSION; - if (ioctl(f,MGA_VID_CONFIG,&mga_vid_config)) - { - perror("Error in mga_vid_config ioctl()"); - printf("Your mga_vid driver version is incompatible with this MPlayer version!\n"); - exit(1); - } - ioctl(f,MGA_VID_ON,0); + mga_vid_config.colkey_on = 0; + mga_vid_config.src_width = 640; + mga_vid_config.src_height = 480; + mga_vid_config.dest_width = 320; + mga_vid_config.dest_height = 200; + mga_vid_config.x_org = 0; + mga_vid_config.y_org = 0; - frame = (char*)mmap(0,mga_vid_config.frame_size*mga_vid_config.num_frames,PROT_WRITE,MAP_SHARED,f,0); - if(!frame){ - printf("Can't mmap mga frame\n"); - exit(1); - } + mga_vid_config.version = MGA_VID_VERSION; + if (ioctl(f, MGA_VID_CONFIG, &mga_vid_config)) { + perror("Error in mga_vid_config ioctl()"); + printf("Your mga_vid driver version is incompatible with this MPlayer version!\n"); + exit(1); + } + ioctl(f, MGA_VID_ON, 0); - //clear the buffer - //memset(frames[0],0x80,mga_vid_config.frame_size*mga_vid_config.num_frames); + frame = (char*)mmap(0, mga_vid_config.frame_size*mga_vid_config.num_frames, + PROT_WRITE,MAP_SHARED, f, 0); + if (!frame) { + printf("Can't mmap mga frame\n"); + exit(1); + } - return 0; + //clear the buffer + //memset(frames[0], 0x80, mga_vid_config.frame_size*mga_vid_config.num_frames); + return 0; } #endif @@ -78,45 +76,48 @@ static int mga_init(void) // Returns current time in microseconds static unsigned int GetTimer(void) { - struct timeval tv; - struct timezone tz; -// float s; - gettimeofday(&tv,&tz); -// s=tv.tv_usec;s*=0.000001;s+=tv.tv_sec; - return tv.tv_sec * 1000000 + tv.tv_usec; -} - -static inline unsigned long long int read_tsc( void ) -{ - unsigned long long int retval; - __asm__ volatile ("rdtsc":"=A"(retval)::"memory"); - return retval; + struct timeval tv; + struct timezone tz; + //float s; + gettimeofday(&tv, &tz); + //s = tv.tv_usec; s *= 0.000001; s += tv.tv_sec; + return tv.tv_sec * 1000000 + tv.tv_usec; } -unsigned char __attribute__((aligned(4096)))arr1[ARR_SIZE],arr2[ARR_SIZE]; - -int main( void ) +static inline unsigned long long int read_tsc(void) { - unsigned long long int v1,v2; - unsigned char * marr1,*marr2; - int i; - unsigned int t; + unsigned long long int retval; + __asm__ volatile ("rdtsc":"=A" (retval)::"memory"); + return retval; +} + +unsigned char __attribute__((aligned(4096)))arr1[ARR_SIZE], arr2[ARR_SIZE]; + +int main(void) +{ + unsigned long long int v1, v2; + unsigned char *marr1, *marr2; + int i; + unsigned int t; #ifdef CONFIG_MGA - mga_init(); - marr1 = &frame[3]; + mga_init(); + marr1 = &frame[3]; #else - marr1 = &arr1[0]; + marr1 = &arr1[0]; #endif - marr2 = &arr2[0]; + marr2 = &arr2[0]; - for(i=0; i Date: Mon, 9 Mar 2009 11:32:43 +0000 Subject: [PATCH 42/89] comment/output cosmetics git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28904 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/fastmemcpybench.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/TOOLS/fastmemcpybench.c b/TOOLS/fastmemcpybench.c index 66bb1671c5..0281cdab2c 100644 --- a/TOOLS/fastmemcpybench.c +++ b/TOOLS/fastmemcpybench.c @@ -1,10 +1,10 @@ /* - fastmemcpybench.c used to benchmark fastmemcpy.h code from libvo. - - Note: this code can not be used on PentMMX-PII because they contain - a bug in rdtsc. For Intel processors since P6(PII) rdpmc should be used - instead. For PIII it's disputable and seems bug was fixed but I don't - tested it. + * benchmark tool for fast_memcpy code from libvo + * + * NOTE: This code can not be used on Pentium MMX / II because they contain + * a bug in rdtsc. For Intel processors since P6(PII) rdpmc should be used + * instead. For PIII it's disputable and it seems the bug was fixed but this + * was not confirmed through testing. */ /* According to Uoti this code is broken. */ @@ -34,7 +34,7 @@ static int mga_init(void) { f = open("/dev/mga_vid", O_RDWR); if (f == -1) { - fprintf(stderr, "Couldn't open /dev/mga_vid\n"); + fprintf(stderr, "Couldn't open /dev/mga_vid.\n"); return -1; } @@ -61,7 +61,7 @@ static int mga_init(void) frame = (char*)mmap(0, mga_vid_config.frame_size*mga_vid_config.num_frames, PROT_WRITE,MAP_SHARED, f, 0); if (!frame) { - printf("Can't mmap mga frame\n"); + printf("Can't mmap MGA frame.\n"); exit(1); } @@ -117,7 +117,7 @@ int main(void) v2 = read_tsc(); t = GetTimer() - t; // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t - printf(NAME ": cpu clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, + printf(NAME ": CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); return 0; } From 526d2f16c2c4a0b6346259543d1ec628c3651cb4 Mon Sep 17 00:00:00 2001 From: Gabrov Date: Mon, 9 Mar 2009 12:29:42 +0000 Subject: [PATCH 43/89] synced with r28895 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28905 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/hu/mplayer.1 | 20 +++++++++++++------- help/help_mp-hu.h | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/DOCS/man/hu/mplayer.1 b/DOCS/man/hu/mplayer.1 index f0185ad174..415a7141b3 100644 --- a/DOCS/man/hu/mplayer.1 +++ b/DOCS/man/hu/mplayer.1 @@ -1,4 +1,4 @@ -.\" Synced with r28807 +.\" Synced with r28895 .\" MPlayer (C) 2000-2009 MPlayer Team .\" Ezt a man oldalt Gabucino, Diego Biurrun és Jonas Jermann készíti/készítette .\" Karbantartó: Gabrov @@ -33,7 +33,7 @@ .\" Név .\" -------------------------------------------------------------------------- . -.TH MPlayer 1 "2009. 03. 05." "MPlayer Project" "A film lejátszó" +.TH MPlayer 1 "2009. 03. 09." "MPlayer Project" "A film lejátszó" . .SH NÉV mplayer \- film lejátszó @@ -958,6 +958,8 @@ Az Apple IR t Egy gomb automatikus ismétlése elõtti késleltetés miliszekundumban (0: kikapcsolás). .IPs ar-rate Billentyû/másodperc érték megadása autorepeat használata esetén. +.IPs (no)default-binds +Az alapértelmezetten MPlayerbe épített billentyû-hozzárendeléseket használja. .IPs keylist Az összes használható billentyû listájának kiírása. .IPs cmdlist @@ -1134,6 +1136,8 @@ parancsokat olvas az stdin-r .I MEGJEGYZÉS: A \-input cmdlist kapcsoló kilistázza a szolga módban használható parancsokat, a DOCS/tech/slave.txt fájlban megtalálod a leírásukat. +Ez nem a többi, pl. a videó ablakon keresztül érkezõ input letiltására készült, +arra használj mást, mint a \-input nodefault\-binds:conf=/dev/null. . .TP .B \-softsleep @@ -2258,14 +2262,14 @@ Akkor haszn és nem a végén. . .TP -.B \-font <útvonal a font.desc fájlhoz> +.B \-font <útvonal a font.desc fájlhoz, útvonal a betûtípushoz (FreeType), betûtípus minta (Fontconfig)> Az OSD/\:SUB betûtipusok megadott könyvtárban történõ keresése (normál fontoknál alapértelmezett: ~/\:.mplayer/\:font/\:font.desc, FreeType fontokhoz: ~/.mplayer/\:subfont.ttf). .br .I MEGJEGYZÉS: FreeType-pal ez az opció a szöveges betûtípus fájlok elérési útját határozza meg. -A fontconfig-gal ez az opció a fontconfig betûtípus nevét határozza meg. +A fontconfig-gal ez az opció a Fontconfig betûtípus mintáját határozza meg. .sp 1 .I PÉLDA: .PD 0 @@ -2275,6 +2279,8 @@ A fontconfig-gal ez az opci \-font ~/\:.mplayer/\:arialuni.ttf .br \-font 'Bitstream Vera Sans' +.br +\-font 'Bitstream Vera Sans:style=Bold' .RE .PD 1 . @@ -2514,9 +2520,9 @@ Jelenleg haszontalan. Ugyan az, mint az \-audiofile, de felirat folyamokra (OggDS?). . .TP -.B \-subfont (csak FreeType) -Beállítja a felirat betûtípusát. -Ha nincs megafva a \-subfont, a \-font lesz használva. +.B \-subfont <útvonal a betûtípushoz (FreeType), betûtípus minta (Fontconfig)> (csak FreeType) +Beállítja a felirat betûtípusát (lásd \-font). +Ha nincs megadva a \-subfont, a \-font lesz használva. . .TP .B \-subfont\-autoscale <0\-3> (csak FreeType) diff --git a/help/help_mp-hu.h b/help/help_mp-hu.h index dac9dd29e7..770c552b88 100644 --- a/help/help_mp-hu.h +++ b/help/help_mp-hu.h @@ -3,7 +3,7 @@ //... Okay enough of the hw, now send the other two! // // Updated by: Gabrov -// Sync'ed with help_mp-en.h r28122 (2008. 12. 17.) +// Sync'ed with help_mp-en.h r28860 (2009. 03. 09.) // ========================= MPlayer help =========================== From 591ce556b732b638804a0336cb8c17168251e17d Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 12:59:14 +0000 Subject: [PATCH 44/89] Make fastmemcpybench almost working - only thing missing is a way to override HAVE_MMX etc. from config.h. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28906 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 4 ++-- TOOLS/fastmemcpybench.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2822754600..5c25dcb003 100644 --- a/Makefile +++ b/Makefile @@ -1029,8 +1029,8 @@ TOOLS/fastmem-mga-sse$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=0 -DHAVE_ fastmemcpybench: $(addsuffix $(EXESUF),$(addprefix TOOLS/fastmem-,c mmx k6 k7 sse mga-mmx mga-k6 mga-k7 mga-sse)) -TOOLS/fastmem-%$(EXESUF): TOOLS/fastmemcpybench.c - $(CC) $(CFLAGS) -o $@ $< +TOOLS/fastmem-%$(EXESUF): TOOLS/fastmemcpybench.c libvo/aclib.c + $(CC) $(CFLAGS) -o $@ $^ REAL_SRCS = $(wildcard TOOLS/realcodecs/*.c) REAL_TARGETS = $(REAL_SRCS:.c=.so.6.0) diff --git a/TOOLS/fastmemcpybench.c b/TOOLS/fastmemcpybench.c index 0281cdab2c..48a29374c3 100644 --- a/TOOLS/fastmemcpybench.c +++ b/TOOLS/fastmemcpybench.c @@ -18,6 +18,7 @@ #include #include #include +#include "libvo/fastmemcpy.h" //#define ARR_SIZE 100000 #define ARR_SIZE (1024*768*2) @@ -113,7 +114,7 @@ int main(void) t = GetTimer(); v1 = read_tsc(); for (i = 0; i < 100; i++) - memcpy(marr1, marr2, ARR_SIZE - 16); + fast_memcpy(marr1, marr2, ARR_SIZE - 16); v2 = read_tsc(); t = GetTimer() - t; // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t From 601d694829fd572d9f18a52c775cae958abc4d2c Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 13:11:37 +0000 Subject: [PATCH 45/89] Remove native nuv demuxer, it only needs more code to achieve the same thing as the libavformat demuxer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28907 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/tech/MAINTAINERS | 1 - Makefile | 1 - libmpdemux/demux_nuv.c | 461 ----------------------------------------- libmpdemux/demuxer.c | 2 - 4 files changed, 465 deletions(-) delete mode 100644 libmpdemux/demux_nuv.c diff --git a/DOCS/tech/MAINTAINERS b/DOCS/tech/MAINTAINERS index 087d566212..68b0768bc4 100644 --- a/DOCS/tech/MAINTAINERS +++ b/DOCS/tech/MAINTAINERS @@ -116,7 +116,6 @@ demuxers: * demux_rtp* - Ross Finlayson * demux_mpg and demux_ts - Nico Sabbi * demux_mpc.c - Reimar Döffinger - * demux_nuv.c - Reimar Döffinger muxers: * muxer_lavf.c - Michael Niedermayer diff --git a/Makefile b/Makefile index 5c25dcb003..b1ea48e963 100644 --- a/Makefile +++ b/Makefile @@ -184,7 +184,6 @@ SRCS_COMMON = asxparser.c \ libmpdemux/demux_mov.c \ libmpdemux/demux_mpg.c \ libmpdemux/demux_nsv.c \ - libmpdemux/demux_nuv.c \ libmpdemux/demux_pva.c \ libmpdemux/demux_rawaudio.c \ libmpdemux/demux_rawvideo.c \ diff --git a/libmpdemux/demux_nuv.c b/libmpdemux/demux_nuv.c deleted file mode 100644 index 2ca1d2b452..0000000000 --- a/libmpdemux/demux_nuv.c +++ /dev/null @@ -1,461 +0,0 @@ -/* - * NuppelVideo 0.05 file parser - * for MPlayer - * by Panagiotis Issaris - * - * Reworked by alex - */ - -#include -#include -#include - -#include "config.h" -#include "mp_msg.h" -#include "help_mp.h" -#include "stream/stream.h" -#include "demuxer.h" -#include "stheader.h" -#include "nuppelvideo.h" - - -struct nuv_signature -{ - char finfo[12]; /* "NuppelVideo" + \0 */ - char version[5]; /* "0.05" + \0 */ -}; - -typedef struct nuv_position_t nuv_position_t; - -struct nuv_position_t -{ - off_t offset; - float time; - int frame; - nuv_position_t* next; -}; - -typedef struct nuv_info_t -{ - int current_audio_frame; - int current_video_frame; - nuv_position_t *index_list; - nuv_position_t *current_position; -} nuv_priv_t; - -/** - * \brief find best matching bitrate (in kbps) out of a table - * \param bitrate bitrate to find best match for - * \return best match from table - */ -static int nearestBitrate(int bitrate) { - const int rates[17] = {8000, 16000, 24000, 32000, 40000, 48000, 56000, - 64000, 80000, 96000, 112000, 128000, 160000, - 192000, 224000, 256000, 320000}; - int i; - for (i = 0; i < 16; i++) { - if ((rates[i] + rates[i + 1]) / 2 > bitrate) - break; - } - return rates[i]; -} - -/** - * Seek to a position relative to the current position, indicated in time. - */ -static void demux_seek_nuv ( demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags ) -{ -#define MAX_TIME 1000000 - nuv_priv_t* priv = demuxer->priv; - struct rtframeheader rtjpeg_frameheader; - off_t orig_pos; - off_t curr_pos; - float current_time = 0; - float start_time = MAX_TIME; - float target_time = start_time + rel_seek_secs * 1000; /* target_time, start_time are ms, rel_seek_secs s */ - - orig_pos = stream_tell ( demuxer->stream ); - - if ( rel_seek_secs > 0 ) - { - /* Seeking forward */ - - - while(current_time < target_time ) - { - if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader)) - return; /* EOF */ - le2me_rtframeheader(&rtjpeg_frameheader); - - if ( rtjpeg_frameheader.frametype == 'V' ) - { - priv->current_position->next = (nuv_position_t*) malloc ( sizeof ( nuv_position_t ) ); - priv->current_position = priv->current_position->next; - priv->current_position->frame = priv->current_video_frame++; - priv->current_position->time = rtjpeg_frameheader.timecode; - priv->current_position->offset = orig_pos; - priv->current_position->next = NULL; - - if ( start_time == MAX_TIME ) - { - start_time = rtjpeg_frameheader.timecode; - /* Recalculate target time with real start time */ - target_time = start_time + rel_seek_secs*1000; - } - - current_time = rtjpeg_frameheader.timecode; - - curr_pos = stream_tell ( demuxer->stream ); - stream_seek ( demuxer->stream, curr_pos + rtjpeg_frameheader.packetlength ); - - /* Adjust current sequence pointer */ - } - else if ( rtjpeg_frameheader.frametype == 'A' ) - { - if ( start_time == MAX_TIME ) - { - start_time = rtjpeg_frameheader.timecode; - /* Recalculate target time with real start time */ - target_time = start_time + rel_seek_secs * 1000; - } - current_time = rtjpeg_frameheader.timecode; - - - curr_pos = stream_tell ( demuxer->stream ); - stream_seek ( demuxer->stream, curr_pos + rtjpeg_frameheader.packetlength ); - } - } - } - else - { - /* Seeking backward */ - nuv_position_t* p; - start_time = priv->current_position->time; - - /* Recalculate target time with real start time */ - target_time = start_time + rel_seek_secs * 1000; - - - if(target_time < 0) - target_time = 0; - - // Search the target time in the index list, get the offset - // and go to that offset. - p = priv->index_list; - while ( ( p->next != NULL ) && ( p->time < target_time ) ) - { - p = p->next; - } - stream_seek ( demuxer->stream, p->offset ); - priv->current_video_frame = p->frame; - } -} - - -static int demux_nuv_fill_buffer ( demuxer_t *demuxer, demux_stream_t *ds ) -{ - struct rtframeheader rtjpeg_frameheader; - off_t orig_pos; - nuv_priv_t* priv = demuxer->priv; - int want_audio = (demuxer->audio)&&(demuxer->audio->id!=-2); - - demuxer->filepos = orig_pos = stream_tell ( demuxer->stream ); - if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader)) - return 0; /* EOF */ - le2me_rtframeheader(&rtjpeg_frameheader); - -#if 0 - printf("NUV frame: frametype: %c, comptype: %c, packetlength: %d\n", - rtjpeg_frameheader.frametype, rtjpeg_frameheader.comptype, - rtjpeg_frameheader.packetlength); -#endif - - /* Skip Seekpoint, Extended header and Sync for now */ - if ((rtjpeg_frameheader.frametype == 'R') || - (rtjpeg_frameheader.frametype == 'X') || - (rtjpeg_frameheader.frametype == 'S')) - return 1; - - /* Skip seektable and text (these have a payload) */ - if ((rtjpeg_frameheader.frametype == 'Q') || - (rtjpeg_frameheader.frametype == 'T')) { - stream_skip(demuxer->stream, rtjpeg_frameheader.packetlength); - return 1; - } - - if (((rtjpeg_frameheader.frametype == 'D') && - (rtjpeg_frameheader.comptype == 'R')) || - (rtjpeg_frameheader.frametype == 'V')) - { - if ( rtjpeg_frameheader.frametype == 'V' ) - { - priv->current_video_frame++; - priv->current_position->next = (nuv_position_t*) malloc(sizeof(nuv_position_t)); - priv->current_position = priv->current_position->next; - priv->current_position->frame = priv->current_video_frame; - priv->current_position->time = rtjpeg_frameheader.timecode; - priv->current_position->offset = orig_pos; - priv->current_position->next = NULL; - } - /* put RTjpeg tables, Video info to video buffer */ - stream_seek ( demuxer->stream, orig_pos ); - ds_read_packet ( demuxer->video, demuxer->stream, rtjpeg_frameheader.packetlength + 12, - rtjpeg_frameheader.timecode*0.001, orig_pos, 0 ); - - - } else - if (demuxer->audio && (rtjpeg_frameheader.frametype == 'A')) - { - priv->current_audio_frame++; - if (want_audio) { - /* put Audio to audio buffer */ - ds_read_packet ( demuxer->audio, demuxer->stream, - rtjpeg_frameheader.packetlength, - rtjpeg_frameheader.timecode*0.001, - orig_pos + 12, 0 ); - } else { - /* skip audio block */ - stream_skip ( demuxer->stream, - rtjpeg_frameheader.packetlength ); - } - } - - return 1; -} - -/* Scan for the extended data in MythTV nuv streams */ -static int demux_xscan_nuv(demuxer_t* demuxer, int width, int height) { - int i; - off_t orig_pos = stream_tell(demuxer->stream); - struct rtframeheader rtjpeg_frameheader; - struct extendeddata ext; - sh_video_t* sh_video = demuxer->video->sh; - sh_audio_t* sh_audio = demuxer->audio->sh; - - for (i = 0; i < 2; ++i) { - if (stream_read(demuxer->stream, (char*)&rtjpeg_frameheader, - sizeof(rtjpeg_frameheader)) < sizeof(rtjpeg_frameheader)) - goto out; - le2me_rtframeheader(&rtjpeg_frameheader); - - if (rtjpeg_frameheader.frametype != 'X') - stream_skip(demuxer->stream, rtjpeg_frameheader.packetlength); - } - - if ( rtjpeg_frameheader.frametype != 'X' ) - goto out; - - if (rtjpeg_frameheader.packetlength != sizeof(ext)) { - mp_msg(MSGT_DEMUXER, MSGL_WARN, - "NUV extended frame does not have expected length, ignoring\n"); - goto out; - } - - if (stream_read(demuxer->stream, (char*)&ext, sizeof(ext)) < sizeof(ext)) - goto out; - le2me_extendeddata(&ext); - - if (ext.version != 1) { - mp_msg(MSGT_DEMUXER, MSGL_WARN, - "NUV extended frame has unknown version number (%d), ignoring\n", - ext.version); - goto out; - } - - mp_msg(MSGT_DEMUXER, MSGL_V, "Detected MythTV stream\n"); - - /* Video parameters */ - mp_msg(MSGT_DEMUXER, MSGL_V, "FOURCC: %c%c%c%c\n", - (ext.video_fourcc >> 24) & 0xff, - (ext.video_fourcc >> 16) & 0xff, - (ext.video_fourcc >> 8) & 0xff, - (ext.video_fourcc) & 0xff); - sh_video->format = ext.video_fourcc; - sh_video->i_bps = ext.lavc_bitrate; - - /* Audio parameters */ - if (ext.audio_fourcc == mmioFOURCC('L', 'A', 'M', 'E')) { - sh_audio->format = 0x55; - } else if (ext.audio_fourcc == mmioFOURCC('R', 'A', 'W', 'A')) { - sh_audio->format = 0x1; - } else { - mp_msg(MSGT_DEMUXER, MSGL_WARN, - "Unknown audio format 0x%x\n", ext.audio_fourcc); - } - - sh_audio->channels = ext.audio_channels; - sh_audio->samplerate = ext.audio_sample_rate; - sh_audio->i_bps = sh_audio->channels * sh_audio->samplerate * - ext.audio_bits_per_sample; - if (sh_audio->format != 0x1) - sh_audio->i_bps = nearestBitrate(sh_audio->i_bps / - ext.audio_compression_ratio); - sh_audio->wf->wFormatTag = sh_audio->format; - sh_audio->wf->nChannels = sh_audio->channels; - sh_audio->wf->nSamplesPerSec = sh_audio->samplerate; - sh_audio->wf->nAvgBytesPerSec = sh_audio->i_bps / 8; - sh_audio->wf->nBlockAlign = sh_audio->channels * 2; - sh_audio->wf->wBitsPerSample = ext.audio_bits_per_sample; - sh_audio->wf->cbSize = 0; - - mp_msg(MSGT_DEMUXER, MSGL_V, - "channels=%d bitspersample=%d samplerate=%d compression_ratio=%d\n", - ext.audio_channels, ext.audio_bits_per_sample, - ext.audio_sample_rate, ext.audio_compression_ratio); - return 1; -out: - stream_reset(demuxer->stream); - stream_seek(demuxer->stream, orig_pos); - return 0; -} - -static demuxer_t* demux_open_nuv ( demuxer_t* demuxer ) -{ - sh_video_t *sh_video = NULL; - sh_audio_t *sh_audio = NULL; - struct rtfileheader rtjpeg_fileheader; - nuv_priv_t* priv = (nuv_priv_t*) malloc ( sizeof ( nuv_priv_t) ); - demuxer->priv = priv; - priv->current_audio_frame = 0; - priv->current_video_frame = 0; - - - /* Go to the start */ - stream_reset(demuxer->stream); - stream_seek(demuxer->stream, 0); - - stream_read ( demuxer->stream, (char*)& rtjpeg_fileheader, sizeof(rtjpeg_fileheader) ); - le2me_rtfileheader(&rtjpeg_fileheader); - - /* no video */ - if (rtjpeg_fileheader.videoblocks == 0) - { - mp_msg(MSGT_DEMUXER, MSGL_INFO, MSGTR_MPDEMUX_NUV_NoVideoBlocksInFile); - return NULL; - } - - /* Create a new video stream header */ - sh_video = new_sh_video ( demuxer, 0 ); - - /* Make sure the demuxer knows about the new video stream header - * (even though new_sh_video() ought to take care of it) - */ - demuxer->video->sh = sh_video; - - /* Make sure that the video demuxer stream header knows about its - * parent video demuxer stream (this is getting wacky), or else - * video_read_properties() will choke - */ - sh_video->ds = demuxer->video; - - /* Custom fourcc for internal MPlayer use */ - sh_video->format = mmioFOURCC('N', 'U', 'V', '1'); - - sh_video->disp_w = rtjpeg_fileheader.width; - sh_video->disp_h = rtjpeg_fileheader.height; - - /* NuppelVideo uses pixel aspect ratio - here display aspect ratio is used. - For the moment NuppelVideo only supports 1.0 thus - 1.33 == 4:3 aspect ratio. - */ - if(rtjpeg_fileheader.aspect == 1.0) - sh_video->aspect = (float) 4.0f/3.0f; - - /* Get the FPS */ - sh_video->fps = rtjpeg_fileheader.fps; - sh_video->frametime = 1 / sh_video->fps; - - if (rtjpeg_fileheader.audioblocks != 0) - { - sh_audio = new_sh_audio(demuxer, 0); - demuxer->audio->id = 0; - demuxer->audio->sh = sh_audio; - sh_audio->ds = demuxer->audio; - sh_audio->format = 0x1; - sh_audio->channels = 2; - sh_audio->samplerate = 44100; - - sh_audio->wf = malloc(sizeof(WAVEFORMATEX)); - memset(sh_audio->wf, 0, sizeof(WAVEFORMATEX)); - sh_audio->wf->wFormatTag = sh_audio->format; - sh_audio->wf->nChannels = sh_audio->channels; - sh_audio->wf->wBitsPerSample = 16; - sh_audio->wf->nSamplesPerSec = sh_audio->samplerate; - sh_audio->wf->nAvgBytesPerSec = sh_audio->wf->nChannels* - sh_audio->wf->wBitsPerSample*sh_audio->wf->nSamplesPerSec/8; - sh_audio->wf->nBlockAlign = sh_audio->channels * 2; - sh_audio->wf->cbSize = 0; - } - - /* Check for extended data (X frame) and read settings from it */ - if (!demux_xscan_nuv(demuxer, rtjpeg_fileheader.width, - rtjpeg_fileheader.height)) - /* Otherwise assume defaults */ - mp_msg(MSGT_DEMUXER, MSGL_V, "No NUV extended frame, using defaults\n"); - - - priv->index_list = (nuv_position_t*) malloc(sizeof(nuv_position_t)); - priv->index_list->frame = 0; - priv->index_list->time = 0; - priv->index_list->offset = stream_tell ( demuxer->stream ); - priv->index_list->next = NULL; - priv->current_position = priv->index_list; - - return demuxer; -} - -static int nuv_check_file ( demuxer_t* demuxer ) -{ - struct nuv_signature ns; - - /* Store original position */ - off_t orig_pos = stream_tell(demuxer->stream); - - mp_msg ( MSGT_DEMUX, MSGL_V, "Checking for NuppelVideo\n" ); - - if(stream_read(demuxer->stream,(char*)&ns,sizeof(ns)) != sizeof(ns)) - return 0; - - if ( strncmp ( ns.finfo, "NuppelVideo", 12 ) && - strncmp ( ns.finfo, "MythTVVideo", 12 ) ) - return 0; /* Not a NuppelVideo file */ - if ( strncmp ( ns.version, "0.05", 5 ) && - strncmp ( ns.version, "0.06", 5 ) && - strncmp ( ns.version, "0.07", 5 ) ) - return 0; /* Wrong version NuppelVideo file */ - - /* Return to original position */ - stream_seek ( demuxer->stream, orig_pos ); - return DEMUXER_TYPE_NUV; -} - -static void demux_close_nuv(demuxer_t* demuxer) { - nuv_priv_t* priv = demuxer->priv; - nuv_position_t* pos; - if(!priv) - return; - for(pos = priv->index_list ; pos != NULL ; ) { - nuv_position_t* p = pos; - pos = pos->next; - free(p); - } - free(priv); -} - - -const demuxer_desc_t demuxer_desc_nuv = { - "NuppelVideo demuxer", - "nuv", - "NuppelVideo", - "Panagiotis Issaris", - "", - DEMUXER_TYPE_NUV, - 1, // safe autodetect - nuv_check_file, - demux_nuv_fill_buffer, - demux_open_nuv, - demux_close_nuv, - demux_seek_nuv, - NULL -}; diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index 74bbd8e559..bfe321b37d 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -45,7 +45,6 @@ extern const demuxer_desc_t demuxer_desc_mf; extern const demuxer_desc_t demuxer_desc_avi; extern const demuxer_desc_t demuxer_desc_y4m; extern const demuxer_desc_t demuxer_desc_asf; -extern const demuxer_desc_t demuxer_desc_nuv; extern const demuxer_desc_t demuxer_desc_real; extern const demuxer_desc_t demuxer_desc_smjpeg; extern const demuxer_desc_t demuxer_desc_matroska; @@ -100,7 +99,6 @@ const demuxer_desc_t *const demuxer_list[] = { &demuxer_desc_y4m, &demuxer_desc_asf, &demuxer_desc_nsv, - &demuxer_desc_nuv, &demuxer_desc_real, &demuxer_desc_smjpeg, &demuxer_desc_matroska, From 3a0ffa5bf43a000ce8b0d4a3bd9572dc92f83ff4 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 13:23:27 +0000 Subject: [PATCH 46/89] Remove now unused parts of nuppelvideo.h git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28908 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/nuppelvideo.h | 99 ---------------------------------------- 1 file changed, 99 deletions(-) diff --git a/libmpdemux/nuppelvideo.h b/libmpdemux/nuppelvideo.h index e12c1eb325..8982f443c3 100644 --- a/libmpdemux/nuppelvideo.h +++ b/libmpdemux/nuppelvideo.h @@ -20,29 +20,6 @@ #ifndef MPLAYER_NUPPELVIDEO_H #define MPLAYER_NUPPELVIDEO_H -#include "libavutil/intfloat_readwrite.h" - -typedef struct __attribute__((packed)) rtfileheader -{ - char finfo[12]; // "NuppelVideo" + \0 - char version[5]; // "0.05" + \0 - char pad1[3]; - int width; - int height; - int desiredwidth; // 0 .. as it is - int desiredheight; // 0 .. as it is - char pimode; // P .. progressive - // I .. interlaced (2 half pics) [NI] - char pad2[3]; - double aspect; // 1.0 .. square pixel (1.5 .. e.g. width=480: width*1.5=720 - // for capturing for svcd material - double fps; - int videoblocks; // count of video-blocks -1 .. unknown 0 .. no video - int audioblocks; // count of audio-blocks -1 .. unknown 0 .. no audio - int textsblocks; // count of text-blocks -1 .. unknown 0 .. no text - int keyframedist; -} rtfileheader; - typedef struct __attribute__((packed)) rtframeheader { char frametype; // A .. Audio, V .. Video, S .. Sync, T .. Text @@ -93,87 +70,11 @@ typedef struct __attribute__((packed)) rtframeheader // R: do not use here! (fixed 'RTjjjjjjjjjjjjjj') } rtframeheader; -/* for MythTV */ -typedef struct __attribute__((packed)) extendeddata -{ - int version; // yes, this is repeated from the file header - int video_fourcc; // video encoding method used - int audio_fourcc; // audio encoding method used - // generic data - int audio_sample_rate; - int audio_bits_per_sample; - int audio_channels; - // codec specific - // mp3lame - int audio_compression_ratio; - int audio_quality; - // rtjpeg - int rtjpeg_quality; - int rtjpeg_luma_filter; - int rtjpeg_chroma_filter; - // libavcodec - int lavc_bitrate; - int lavc_qmin; - int lavc_qmax; - int lavc_maxqdiff; - // unused for later -- total size of 128 integers. - // new fields must be added at the end, above this comment. - int expansion[113]; -} extendeddata; - #define FRAMEHEADERSIZE sizeof(rtframeheader) -#define FILEHEADERSIZE sizeof(rtfileheader) -typedef struct vidbuffertype -{ - int sample; - int timecode; - int freeToEncode; - int freeToBuffer; - unsigned char *buffer_offset; -} vidbuffertyp; - -typedef struct audbuffertype -{ - int sample; - int timecode; - int freeToEncode; - int freeToBuffer; - unsigned char *buffer_offset; -} audbuffertyp; - -#define le2me_rtfileheader(h) { \ - (h)->width = le2me_32((h)->width); \ - (h)->height = le2me_32((h)->height); \ - (h)->desiredwidth = le2me_32((h)->desiredwidth); \ - (h)->desiredheight = le2me_32((h)->desiredheight); \ - (h)->aspect = av_int2dbl(le2me_64(*(uint64_t *)&(h)->aspect));\ - (h)->fps = av_int2dbl(le2me_64(*(uint64_t *)&(h)->fps)); \ - (h)->videoblocks = le2me_32((h)->videoblocks); \ - (h)->audioblocks = le2me_32((h)->audioblocks); \ - (h)->textsblocks = le2me_32((h)->textsblocks); \ - (h)->keyframedist = le2me_32((h)->keyframedist); \ - } #define le2me_rtframeheader(h) { \ (h)->timecode = le2me_32((h)->timecode); \ (h)->packetlength = le2me_32((h)->packetlength); \ } -#define le2me_extendeddata(h) { \ - (h)->version = le2me_32((h)->version); \ - (h)->video_fourcc = le2me_32((h)->video_fourcc); \ - (h)->audio_fourcc = le2me_32((h)->audio_fourcc); \ - (h)->audio_sample_rate = le2me_32((h)->audio_sample_rate); \ - (h)->audio_bits_per_sample = le2me_32((h)->audio_bits_per_sample);\ - (h)->audio_channels = le2me_32((h)->audio_channels); \ - (h)->audio_compression_ratio = le2me_32((h)->audio_compression_ratio);\ - (h)->audio_quality = le2me_32((h)->audio_quality); \ - (h)->rtjpeg_quality = le2me_32((h)->rtjpeg_quality); \ - (h)->rtjpeg_luma_filter = le2me_32((h)->rtjpeg_luma_filter); \ - (h)->rtjpeg_chroma_filter = le2me_32((h)->rtjpeg_chroma_filter);\ - (h)->lavc_bitrate = le2me_32((h)->lavc_bitrate); \ - (h)->lavc_qmin = le2me_32((h)->lavc_qmin); \ - (h)->lavc_qmax = le2me_32((h)->lavc_qmax); \ - (h)->lavc_maxqdiff = le2me_32((h)->lavc_maxqdiff); \ - } #endif /* MPLAYER_NUPPELVIDEO_H */ From 77195cf5c40e77e9876c4a82808f1819c1d3840b Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 13:37:55 +0000 Subject: [PATCH 47/89] nuv encoder 64 bit fix: avoid using long/sizeof(long) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28909 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ve_nuv.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libmpcodecs/ve_nuv.c b/libmpcodecs/ve_nuv.c index 0b670179cd..4b1691a932 100644 --- a/libmpcodecs/ve_nuv.c +++ b/libmpcodecs/ve_nuv.c @@ -68,6 +68,8 @@ m_option_t nuvopts_conf[]={ //===========================================================================// +#define COMPDATASIZE (128*4) + static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ @@ -75,8 +77,8 @@ static int config(struct vf_instance_s* vf, // We need a buffer wich can holda header and a whole YV12 picture // or a RTJpeg table vf->priv->buf_size = width*height*3/2+FRAMEHEADERSIZE; - if(vf->priv->buf_size < (int)(128*sizeof(long int) + FRAMEHEADERSIZE)) - vf->priv->buf_size = 128*sizeof(long int) + FRAMEHEADERSIZE; + if(vf->priv->buf_size < COMPDATASIZE + FRAMEHEADERSIZE) + vf->priv->buf_size = COMPDATASIZE + FRAMEHEADERSIZE; mux_v->bih->biWidth=width; mux_v->bih->biHeight=height; @@ -110,16 +112,16 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ // This has to be don here otherwise tv with sound doesn't work if(!vf->priv->tbl_wrote) { - RTjpeg_init_compress((long int*)data,mpi->width,mpi->height,vf->priv->q); + RTjpeg_init_compress((uint32_t *)data,mpi->width,mpi->height,vf->priv->q); RTjpeg_init_mcompress(); ench->frametype = 'D'; // compressor data ench->comptype = 'R'; // compressor data for RTjpeg - ench->packetlength = 128*sizeof(long int); + ench->packetlength = COMPDATASIZE; le2me_rtframeheader(ench); mux_v->buffer=vf->priv->buffer; - muxer_write_chunk(mux_v,FRAMEHEADERSIZE + 128*sizeof(long int), 0x10, MP_NOPTS_VALUE, MP_NOPTS_VALUE); + muxer_write_chunk(mux_v,FRAMEHEADERSIZE + COMPDATASIZE, 0x10, MP_NOPTS_VALUE, MP_NOPTS_VALUE); vf->priv->tbl_wrote = 1; memset(ench,0,FRAMEHEADERSIZE); // Reset the header } From c9872edafeb35978253d9d9cacd53e0bc182e976 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 14:30:41 +0000 Subject: [PATCH 48/89] Allocate buffer for lzo compression correctly also for large frame sizes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28910 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ve_nuv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libmpcodecs/ve_nuv.c b/libmpcodecs/ve_nuv.c index 4b1691a932..132e23a944 100644 --- a/libmpcodecs/ve_nuv.c +++ b/libmpcodecs/ve_nuv.c @@ -24,8 +24,7 @@ #include "native/rtjpegn.h" #define LZO_AL(size) (((size) + (sizeof(long) - 1)) / sizeof(long)) -#define LZO_IN_LEN (1024*1024L) -#define LZO_OUT_LEN (LZO_IN_LEN + LZO_IN_LEN / 64 + 16 + 3) +#define LZO_OUT_LEN(in) ((in) + (in) / 64 + 16 + 3) //===========================================================================// @@ -85,6 +84,8 @@ static int config(struct vf_instance_s* vf, mux_v->bih->biSizeImage=mux_v->bih->biWidth*mux_v->bih->biHeight*(mux_v->bih->biBitCount/8); mux_v->aspect = (float)d_width/d_height; vf->priv->buffer = realloc(vf->priv->buffer,vf->priv->buf_size); + if (vf->priv->lzo) + vf->priv->zbuffer = realloc(vf->priv->zbuffer, FRAMEHEADERSIZE + LZO_OUT_LEN(vf->priv->buf_size)); vf->priv->tbl_wrote = 0; return 1; @@ -218,8 +219,7 @@ static int vf_open(vf_instance_t *vf, char* args){ if(lzo_init() != LZO_E_OK) { mp_msg(MSGT_VFILTER,MSGL_WARN,"LZO init failed: no lzo compression\n"); vf->priv->lzo = 0; - } - vf->priv->zbuffer = (lzo_bytep)malloc(FRAMEHEADERSIZE + LZO_OUT_LEN); + } else vf->priv->zmem = malloc(sizeof(long)*LZO_AL(LZO1X_1_MEM_COMPRESS)); } From 78383383f77308f44dfd94aea1e3b6af77cd1cef Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 14:32:19 +0000 Subject: [PATCH 49/89] Do not calculate the same value twice git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28911 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ve_nuv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpcodecs/ve_nuv.c b/libmpcodecs/ve_nuv.c index 132e23a944..edf5664244 100644 --- a/libmpcodecs/ve_nuv.c +++ b/libmpcodecs/ve_nuv.c @@ -132,7 +132,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ len = mpi->width*mpi->height*3/2; // Try lzo ??? if(vf->priv->lzo) { - r = lzo1x_1_compress(mpi->planes[0],mpi->width*mpi->height*3/2, + r = lzo1x_1_compress(mpi->planes[0],len, zdata,&zlen,vf->priv->zmem); if(r != LZO_E_OK) { mp_msg(MSGT_VFILTER,MSGL_ERR,"LZO compress error\n"); From f10bffc6f8e5946d5ee0c2b02a45c4d7dad63b33 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 14:40:55 +0000 Subject: [PATCH 50/89] Fix type of zlen, fixes crashes on 64 bit systems. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28912 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ve_nuv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmpcodecs/ve_nuv.c b/libmpcodecs/ve_nuv.c index edf5664244..1a8e5c0c42 100644 --- a/libmpcodecs/ve_nuv.c +++ b/libmpcodecs/ve_nuv.c @@ -105,7 +105,8 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ struct rtframeheader* ench = (struct rtframeheader*)vf->priv->buffer; uint8_t* data = vf->priv->buffer + FRAMEHEADERSIZE; uint8_t* zdata = vf->priv->zbuffer + FRAMEHEADERSIZE; - int len = 0, zlen = 0,r; + int len = 0, r; + size_t zlen = 0; memset(vf->priv->buffer,0,FRAMEHEADERSIZE); // Reset the header if(vf->priv->lzo) From 9545a4a211fc124b79a35e6ff5070643eb00b87e Mon Sep 17 00:00:00 2001 From: compn Date: Mon, 9 Mar 2009 14:49:17 +0000 Subject: [PATCH 51/89] people are forgetting to update the changelog git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28913 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changelog b/Changelog index 5cf0d4d533..c78a4b4f48 100644 --- a/Changelog +++ b/Changelog @@ -37,6 +37,7 @@ MPlayer (1.0) * Brooktree YUV 4:1:1 Raw (Y41P) via binary DLL * many rare/obscure fourccs for known formats added * lower priority for binary Linux rv3040 codecs due to bugs + * remove native NuppleVideo decoder, use lavc instead Demuxers: * -lavfdopts cryptokey allows decrypting MXF and ASF files @@ -55,6 +56,7 @@ MPlayer (1.0) * support seeking in multirate RealMedia files * FLAC speedup in lavf demuxer * MNG demuxer + * remove native NuppleVideo demuxer, use lavf demuxer instead Filters: * vf_ow new overcomplete wavelet denoiser @@ -166,6 +168,8 @@ MPlayer (1.0) * libdvdcss updated to 1.2.10, now same as upstream version * fix -endchapter support again for -dump* options * add startup volume option + * add option to disable default key binds + * change default OSD and subtitle font size to a smaller default libass: * various fixes and updates to match VSFilter renderer From 8c5b570b50f956366be55b78c754c26a02c3d817 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 15:01:12 +0000 Subject: [PATCH 52/89] Get rid of nuppelvideo.h and its ugly packed struct and instead write the frame header directly in nuv encoder. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28914 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ve_nuv.c | 35 +++++++++--------- libmpdemux/nuppelvideo.h | 80 ---------------------------------------- 2 files changed, 17 insertions(+), 98 deletions(-) delete mode 100644 libmpdemux/nuppelvideo.h diff --git a/libmpcodecs/ve_nuv.c b/libmpcodecs/ve_nuv.c index 1a8e5c0c42..af6a1dff57 100644 --- a/libmpcodecs/ve_nuv.c +++ b/libmpcodecs/ve_nuv.c @@ -19,7 +19,7 @@ #include "mp_image.h" #include "vf.h" -#include "libmpdemux/nuppelvideo.h" +#include "libavutil/intreadwrite.h" #include #include "native/rtjpegn.h" @@ -68,6 +68,7 @@ m_option_t nuvopts_conf[]={ #define COMPDATASIZE (128*4) +#define FRAMEHEADERSIZE 12 static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, @@ -102,13 +103,13 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt){ } static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ - struct rtframeheader* ench = (struct rtframeheader*)vf->priv->buffer; + uint8_t *header = vf->priv->buffer; uint8_t* data = vf->priv->buffer + FRAMEHEADERSIZE; uint8_t* zdata = vf->priv->zbuffer + FRAMEHEADERSIZE; int len = 0, r; size_t zlen = 0; - memset(vf->priv->buffer,0,FRAMEHEADERSIZE); // Reset the header + memset(header, 0, FRAMEHEADERSIZE); // Reset the header if(vf->priv->lzo) memset(vf->priv->zbuffer,0,FRAMEHEADERSIZE); @@ -117,15 +118,14 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ RTjpeg_init_compress((uint32_t *)data,mpi->width,mpi->height,vf->priv->q); RTjpeg_init_mcompress(); - ench->frametype = 'D'; // compressor data - ench->comptype = 'R'; // compressor data for RTjpeg - ench->packetlength = COMPDATASIZE; + header[0] = 'D'; // frametype: compressor data + header[1] = 'R'; // comptype: compressor data for RTjpeg + AV_WL32(header + 8, COMPDATASIZE); // packetlength - le2me_rtframeheader(ench); mux_v->buffer=vf->priv->buffer; muxer_write_chunk(mux_v,FRAMEHEADERSIZE + COMPDATASIZE, 0x10, MP_NOPTS_VALUE, MP_NOPTS_VALUE); vf->priv->tbl_wrote = 1; - memset(ench,0,FRAMEHEADERSIZE); // Reset the header + memset(header, 0, FRAMEHEADERSIZE); // Reset the header } // Raw picture @@ -143,10 +143,10 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ if(zlen <= 0 || zlen > len) { memcpy(data,mpi->planes[0],len); - ench->comptype = '0'; + header[1] = '0'; // comptype: uncompressed } else { // Use lzo only if it's littler - ench = (struct rtframeheader*)vf->priv->zbuffer; - ench->comptype = '3'; + header = vf->priv->zbuffer; + header[1] = '3'; //comptype: lzo len = zlen; } @@ -167,19 +167,18 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ } if(zlen <= 0 || zlen > len) - ench->comptype = '1'; + header[1] = '1'; // comptype: RTjpeg else { - ench = (struct rtframeheader*)vf->priv->zbuffer; - ench->comptype = '2'; + header = vf->priv->zbuffer; + header[1] = '2'; // comptype: RTjpeg + LZO len = zlen; } } - ench->frametype = 'V'; // video frame - ench->packetlength = len; - le2me_rtframeheader(ench); - mux_v->buffer=(void*)ench; + header[0] = 'V'; // frametype: video frame + AV_WL32(header + 8, len); // packetlength + mux_v->buffer = header; muxer_write_chunk(mux_v, len + FRAMEHEADERSIZE, 0x10, pts, pts); return 1; } diff --git a/libmpdemux/nuppelvideo.h b/libmpdemux/nuppelvideo.h deleted file mode 100644 index 8982f443c3..0000000000 --- a/libmpdemux/nuppelvideo.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - nuppelvideo.h taken from NuppelVideo, by - (c) Roman Hochleitner roman@mars.tuwien.ac.at - - This program 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. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef MPLAYER_NUPPELVIDEO_H -#define MPLAYER_NUPPELVIDEO_H - -typedef struct __attribute__((packed)) rtframeheader -{ - char frametype; // A .. Audio, V .. Video, S .. Sync, T .. Text - // R .. Seekpoint: String RTjjjjjjjj (use full packet) - // D .. Addition Data for Compressors - // ct: R .. RTjpeg Tables - - char comptype; // V: 0 .. Uncompressed [NI] - // 1 .. RTJpeg - // 2 .. RTJpeg with lzo afterwards - // N .. black frame - // L .. simply copy last frame (if lost frames) - // A: 0 .. Uncompressed (44100/sec 16bit 2ch) - // 1 .. lzo compression [NI] - // 2 .. layer2 (packet) [NI] - // 3 .. layer3 (packet) [NI] - // F .. flac (lossless) [NI] - // S .. shorten (lossless) [NI] - // N .. null frame loudless - // L .. simply copy last frame (may sound bad) NI - // S: B .. Audio and Video sync point [NI] - // A .. Audio Sync Information - // timecode == effective dsp-frequency*100 - // when reaching this audio sync point - // because many cheap soundcards are unexact - // and have a range from 44000 to 44250 - // instead of the expected exact 44100 S./sec - // V .. Next Video Sync - // timecode == next video framenumber - // S .. Audio,Video,Text Correlation [NI] - char keyframe; // 0 .. keyframe - // 1 .. nr of frame in gop => no keyframe - - char filters; // Every bit stands for one type of filter - // 1 .. Gauss 5 Pixel (8*m+2*l+2*r+2*a+2*b)/16 [NYI] - // 2 .. Gauss 5 Pixel (8*m+1*l+1*r+1*a+1*b)/12 [NYI] - // 4 .. Cartoon Filter [NI] - // 8 .. Reserverd Filter [NI] - // 16 .. Reserverd Filter [NI] - // 32 .. Reserverd Filter [NI] - // 64 .. Reserverd Filter [NI] - // 128 .. Reserverd Filter [NI] - - int timecode; // Timecodeinformation sec*1000 + msecs - - int packetlength; // V,A,T: length of following data in stream - // S: length of packet correl. information [NI] - // R: do not use here! (fixed 'RTjjjjjjjjjjjjjj') -} rtframeheader; - -#define FRAMEHEADERSIZE sizeof(rtframeheader) - -#define le2me_rtframeheader(h) { \ - (h)->timecode = le2me_32((h)->timecode); \ - (h)->packetlength = le2me_32((h)->packetlength); \ - } - -#endif /* MPLAYER_NUPPELVIDEO_H */ From 37e7934dcebe04a3ae6ecacf386ff0eb0b928438 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 15:01:53 +0000 Subject: [PATCH 53/89] Get rid of DEMUXER_TYPE_NUV define, it is no longer used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28915 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demuxer.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index 5e4f0858e8..6a1e26dd02 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -35,7 +35,6 @@ #define DEMUXER_TYPE_FLI 10 #define DEMUXER_TYPE_REAL 11 #define DEMUXER_TYPE_Y4M 12 -#define DEMUXER_TYPE_NUV 13 #define DEMUXER_TYPE_FILM 14 #define DEMUXER_TYPE_ROQ 15 #define DEMUXER_TYPE_MF 16 From 72304af23b416364e5e500f699b7c2daf9708c8f Mon Sep 17 00:00:00 2001 From: kostya Date: Mon, 9 Mar 2009 17:25:43 +0000 Subject: [PATCH 54/89] Mask all unused bits for packed pixel format instead of green and alpha mask only. That fixes the case when converting 15-bit RGB/BGR to YUV and high bit is set for input value(s). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28916 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 6f2e243052..da6278d80c 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -1663,7 +1663,7 @@ static inline void RENAME(name ## _half)(uint8_t *dstU, uint8_t *dstV, uint8_t * {\ int pix0= ((type*)src)[2*i+0];\ int pix1= ((type*)src)[2*i+1];\ - int g= (pix0&(maskg|maska))+(pix1&(maskg|maska));\ + int g= (pix0&~(maskr|maskb))+(pix1&~(maskr|maskb));\ int b= ((pix0+pix1-g)&(maskb|(2*maskb)))>>shb;\ int r= ((pix0+pix1-g)&(maskr|(2*maskr)))>>shr;\ g&= maskg|(2*maskg);\ From 28531054594678e6807cc8b34092903e3e445504 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 18:21:47 +0000 Subject: [PATCH 55/89] Reuse libavutil fifo code instead of reimplementing it over and over. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28917 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_jack.c | 102 ++++++++++++++++------------------------------- libao2/ao_sdl.c | 83 +++++++++----------------------------- 2 files changed, 54 insertions(+), 131 deletions(-) diff --git a/libao2/ao_jack.c b/libao2/ao_jack.c index e861d08aed..494d44aa19 100644 --- a/libao2/ao_jack.c +++ b/libao2/ao_jack.c @@ -36,7 +36,7 @@ #include "osdep/timer.h" #include "subopt-helper.h" -#include "libvo/fastmemcpy.h" +#include "libavutil/fifo.h" #include @@ -68,47 +68,10 @@ static volatile float callback_time = 0; #define CHUNK_SIZE (16 * 1024) //! number of "virtual" chunks the buffer consists of #define NUM_CHUNKS 8 -// This type of ring buffer may never fill up completely, at least -// one byte must always be unused. -// For performance reasons (alignment etc.) one whole chunk always stays -// empty, not only one byte. -#define BUFFSIZE ((NUM_CHUNKS + 1) * CHUNK_SIZE) +#define BUFFSIZE (NUM_CHUNKS * CHUNK_SIZE) //! buffer for audio data -static unsigned char *buffer = NULL; - -//! buffer read position, may only be modified by playback thread or while it is stopped -static volatile int read_pos; -//! buffer write position, may only be modified by MPlayer's thread -static volatile int write_pos; - -/** - * \brief get the number of free bytes in the buffer - * \return number of free bytes in buffer - * - * may only be called by MPlayer's thread - * return value may change between immediately following two calls, - * and the real number of free bytes might be larger! - */ -static int buf_free(void) { - int free = read_pos - write_pos - CHUNK_SIZE; - if (free < 0) free += BUFFSIZE; - return free; -} - -/** - * \brief get amount of data available in the buffer - * \return number of bytes available in buffer - * - * may only be called by the playback thread - * return value may change between immediately following two calls, - * and the real number of buffered bytes might be larger! - */ -static int buf_used(void) { - int used = write_pos - read_pos; - if (used < 0) used += BUFFSIZE; - return used; -} +static AVFifoBuffer *buffer; /** * \brief insert len bytes into buffer @@ -119,22 +82,34 @@ static int buf_used(void) { * If there is not enough room, the buffer is filled up */ static int write_buffer(unsigned char* data, int len) { - int first_len = BUFFSIZE - write_pos; - int free = buf_free(); + int free = BUFFSIZE - av_fifo_size(buffer); if (len > free) len = free; - if (first_len > len) first_len = len; - // till end of buffer - fast_memcpy (&buffer[write_pos], data, first_len); - if (len > first_len) { // we have to wrap around - // remaining part from beginning of buffer - fast_memcpy (buffer, &data[first_len], len - first_len); - } - write_pos = (write_pos + len) % BUFFSIZE; - return len; + return av_fifo_generic_write(buffer, data, len, NULL); } static void silence(float **bufs, int cnt, int num_bufs); +struct deinterleave { + float **bufs; + int num_bufs; + int cur_buf; + int pos; +}; + +static void deinterleave(void *info, void *src, int len) { + struct deinterleave *di = info; + float *s = src; + int i; + len /= sizeof(float); + for (i = 0; i < len; i++) { + di->bufs[di->cur_buf++][di->pos] = s[i]; + if (di->cur_buf >= di->num_bufs) { + di->cur_buf = 0; + di->pos++; + } + } +} + /** * \brief read data from buffer and splitting it into channels * \param bufs num_bufs float buffers, each will contain the data of one channel @@ -149,18 +124,13 @@ static void silence(float **bufs, int cnt, int num_bufs); * with silence. */ static int read_buffer(float **bufs, int cnt, int num_bufs) { - int buffered = buf_used(); - int i, j; + struct deinterleave di = {bufs, num_bufs, 0, 0}; + int buffered = av_fifo_size(buffer); if (cnt * sizeof(float) * num_bufs > buffered) { silence(bufs, cnt, num_bufs); cnt = buffered / sizeof(float) / num_bufs; } - for (i = 0; i < cnt; i++) { - for (j = 0; j < num_bufs; j++) { - bufs[j][i] = *(float *)&buffer[read_pos]; - read_pos = (read_pos + sizeof(float)) % BUFFSIZE; - } - } + av_fifo_generic_read(buffer, &di, cnt * num_bufs * sizeof(float), deinterleave); return cnt; } @@ -268,7 +238,7 @@ static int init(int rate, int channels, int format, int flags) { mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] cannot open server\n"); goto err_out; } - reset(); + buffer = av_fifo_alloc(BUFFSIZE); jack_set_process_callback(client, outputaudio, 0); // list matching ports @@ -308,7 +278,6 @@ static int init(int rate, int channels, int format, int flags) { jack_latency = (float)(jack_port_get_total_latency(client, ports[0]) + jack_get_buffer_size(client)) / (float)rate; callback_interval = 0; - buffer = malloc(BUFFSIZE); ao_data.channels = channels; ao_data.samplerate = rate; @@ -327,7 +296,7 @@ err_out: free(client_name); if (client) jack_client_close(client); - free(buffer); + av_fifo_free(buffer); buffer = NULL; return 0; } @@ -340,7 +309,7 @@ static void uninit(int immed) { reset(); usec_sleep(100 * 1000); jack_client_close(client); - free(buffer); + av_fifo_free(buffer); buffer = NULL; } @@ -349,8 +318,7 @@ static void uninit(int immed) { */ static void reset(void) { paused = 1; - read_pos = 0; - write_pos = 0; + av_fifo_reset(buffer); paused = 0; } @@ -369,7 +337,7 @@ static void audio_resume(void) { } static int get_space(void) { - return buf_free(); + return BUFFSIZE - av_fifo_size(buffer); } /** @@ -383,7 +351,7 @@ static int play(void *data, int len, int flags) { } static float get_delay(void) { - int buffered = BUFFSIZE - CHUNK_SIZE - buf_free(); // could be less + int buffered = av_fifo_size(buffer); // could be less float in_jack = jack_latency; if (estimate && callback_interval > 0) { float elapsed = (float)GetTimer() / 1000000.0 - callback_time; diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c index 6cbd607e67..d5652ccf09 100644 --- a/libao2/ao_sdl.c +++ b/libao2/ao_sdl.c @@ -3,8 +3,6 @@ * * Copyleft 2001 by Felix Bünemann (atmosfear@users.sf.net) * - * Thanks to Arpi for nice ringbuffer-code! - * * This file is part of MPlayer. * * MPlayer is free software; you can redistribute it and/or modify @@ -36,7 +34,7 @@ #include #include "osdep/timer.h" -#include "libvo/fastmemcpy.h" +#include "libavutil/fifo.h" static const ao_info_t info = { @@ -60,76 +58,34 @@ LIBAO_EXTERN(sdl) #define CHUNK_SIZE 4096 #define NUM_CHUNKS 8 -// This type of ring buffer may never fill up completely, at least -// one byte must always be unused. -// For performance reasons (alignment etc.) one whole chunk always stays -// empty, not only one byte. -#define BUFFSIZE ((NUM_CHUNKS + 1) * CHUNK_SIZE) +#define BUFFSIZE (NUM_CHUNKS * CHUNK_SIZE) -static unsigned char *buffer; +static AVFifoBuffer *buffer; -// may only be modified by SDL's playback thread or while it is stopped -static volatile int read_pos; -// may only be modified by mplayer's thread -static volatile int write_pos; #ifdef USE_SDL_INTERNAL_MIXER static unsigned char volume=SDL_MIX_MAXVOLUME; #endif -// may only be called by mplayer's thread -// return value may change between immediately following two calls, -// and the real number of free bytes might be larger! -static int buf_free(void) { - int free = read_pos - write_pos - CHUNK_SIZE; - if (free < 0) free += BUFFSIZE; - return free; -} - -// may only be called by SDL's playback thread -// return value may change between immediately following two calls, -// and the real number of buffered bytes might be larger! -static int buf_used(void) { - int used = write_pos - read_pos; - if (used < 0) used += BUFFSIZE; - return used; -} - static int write_buffer(unsigned char* data,int len){ - int first_len = BUFFSIZE - write_pos; - int free = buf_free(); + int free = BUFFSIZE - av_fifo_size(buffer); if (len > free) len = free; - if (first_len > len) first_len = len; - // till end of buffer - fast_memcpy (&buffer[write_pos], data, first_len); - if (len > first_len) { // we have to wrap around - // remaining part from beginning of buffer - fast_memcpy (buffer, &data[first_len], len - first_len); - } - write_pos = (write_pos + len) % BUFFSIZE; - return len; + return av_fifo_generic_write(buffer, data, len, NULL); } +#ifdef USE_SDL_INTERNAL_MIXER +static void mix_audio(void *dst, void *src, int len) { + SDL_MixAudio(dst, src, len, volume); +} +#endif + static int read_buffer(unsigned char* data,int len){ - int first_len = BUFFSIZE - read_pos; - int buffered = buf_used(); + int buffered = av_fifo_size(buffer); if (len > buffered) len = buffered; - if (first_len > len) first_len = len; - // till end of buffer #ifdef USE_SDL_INTERNAL_MIXER - SDL_MixAudio (data, &buffer[read_pos], first_len, volume); + return av_fifo_generic_read(buffer, data, len, mix_audio); #else - fast_memcpy (data, &buffer[read_pos], first_len); + return av_fifo_generic_read(buffer, data, len, NULL); #endif - if (len > first_len) { // we have to wrap around - // remaining part from beginning of buffer -#ifdef USE_SDL_INTERNAL_MIXER - SDL_MixAudio (&data[first_len], buffer, len - first_len, volume); -#else - fast_memcpy (&data[first_len], buffer, len - first_len); -#endif - } - read_pos = (read_pos + len) % BUFFSIZE; - return len; } // end ring buffer stuff @@ -175,7 +131,7 @@ static int init(int rate,int channels,int format,int flags){ SDL_AudioSpec aspec, obtained; /* Allocate ring-buffer memory */ - buffer = (unsigned char *) malloc(BUFFSIZE); + buffer = av_fifo_alloc(BUFFSIZE); mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_SDL_INFO, rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format)); @@ -278,7 +234,6 @@ void callback(void *userdata, Uint8 *stream, int len); userdata is the pointer s ao_data.buffersize=obtained.size; ao_data.outburst = CHUNK_SIZE; - reset(); /* unsilence audio, if callback is ready */ SDL_PauseAudio(0); @@ -292,6 +247,7 @@ static void uninit(int immed){ usec_sleep(get_delay() * 1000 * 1000); SDL_CloseAudio(); SDL_QuitSubSystem(SDL_INIT_AUDIO); + av_fifo_free(buffer); } // stop playing and empty buffers (for seeking/pause) @@ -301,8 +257,7 @@ static void reset(void){ SDL_PauseAudio(1); /* Reset ring-buffer state */ - read_pos = 0; - write_pos = 0; + av_fifo_reset(buffer); SDL_PauseAudio(0); } @@ -325,7 +280,7 @@ static void audio_resume(void) // return: how many bytes can be played without blocking static int get_space(void){ - return buf_free(); + return BUFFSIZE - av_fifo_size(buffer); } // plays 'len' bytes of 'data' @@ -352,7 +307,7 @@ static int play(void* data,int len,int flags){ // return: delay in seconds between first and last sample in buffer static float get_delay(void){ - int buffered = BUFFSIZE - CHUNK_SIZE - buf_free(); // could be less + int buffered = av_fifo_size(buffer); // could be less return (float)(buffered + ao_data.buffersize)/(float)ao_data.bps; } From 2c64a71a2928bed7b57ab98d6f3130354bab61ae Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 9 Mar 2009 19:15:20 +0000 Subject: [PATCH 56/89] Do not call waveOutReset in uninit if you should wait till playing finishes, and retry waveOutClose if it fails due to still playing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28918 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_win32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libao2/ao_win32.c b/libao2/ao_win32.c index c29e05935f..b2ba0fc573 100644 --- a/libao2/ao_win32.c +++ b/libao2/ao_win32.c @@ -243,8 +243,9 @@ static void uninit(int immed) { if(!immed) usec_sleep(get_delay() * 1000 * 1000); + else waveOutReset(hWaveOut); - waveOutClose(hWaveOut); + while (waveOutClose(hWaveOut) == WAVERR_STILLPLAYING) usec_sleep(0); mp_msg(MSGT_AO, MSGL_V,"waveOut device closed\n"); free(waveBlocks); mp_msg(MSGT_AO, MSGL_V,"buffer memory freed\n"); From 571c0fb8a949fe55fb685060f7b5d190f7c42b7f Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 9 Mar 2009 20:30:24 +0000 Subject: [PATCH 57/89] The first valid index is total count - 1 (usually 0) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28919 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/freesdp/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stream/freesdp/parser.c b/stream/freesdp/parser.c index c17041b7ba..bf6f985e94 100644 --- a/stream/freesdp/parser.c +++ b/stream/freesdp/parser.c @@ -1644,7 +1644,7 @@ const char * fsdp_get_media_format (const fsdp_media_description_t * dsc, unsigned int index) { - if (!dsc || (index < dsc->formats_count)) + if (!dsc || (index < dsc->formats_count - 1)) return NULL; return dsc->formats[index]; } From 540847db7b60c782a2bcf68a9c12dac186d89941 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 9 Mar 2009 20:31:03 +0000 Subject: [PATCH 58/89] Ensure the string we're trying to compare is actually not NULL. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28920 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/librtsp/rtsp_rtp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stream/librtsp/rtsp_rtp.c b/stream/librtsp/rtsp_rtp.c index 0c00e5b454..66c7be4a36 100644 --- a/stream/librtsp/rtsp_rtp.c +++ b/stream/librtsp/rtsp_rtp.c @@ -507,7 +507,8 @@ rtp_setup_and_play (rtsp_t *rtsp_session) } /* only MPEG-TS is supported at the moment */ - if (!strstr (fsdp_get_media_format (med_dsc, 0), + if (!fsdp_get_media_format (med_dsc, 0) || + !strstr (fsdp_get_media_format (med_dsc, 0), RTSP_MEDIA_CONTAINER_MPEG_TS)) { fsdp_description_delete (dsc); From 597bfd44bdcecfb1108d099e3ead21d1c6837e5f Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 9 Mar 2009 20:48:20 +0000 Subject: [PATCH 59/89] partial further sync by patch by sevenfourk, sevenfourk gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28921 b3059339-0415-0410-9bf9-f77b7e298cf2 --- help/help_mp-uk.h | 122 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/help/help_mp-uk.h b/help/help_mp-uk.h index 359e74d4aa..bebc874970 100644 --- a/help/help_mp-uk.h +++ b/help/help_mp-uk.h @@ -947,6 +947,128 @@ static const char help_text[]= #define MSGTR_LIBVO_MGA_ResolutionTooHigh "[MGA] Ð Ð¾Ð·ÑˆÐ¸Ñ€ÐµÐ½Ð½Ñ Ð´Ð¶ÐµÑ€ÐµÐ»Ð°, у крайньому випадку в одному вимірі, більше ніж 1023x1023.\n[MGA] ПеремаÑштабуйте програмно або викорÑтайте -lavdopts lowres=1.\n" #define MSGTR_LIBVO_MGA_mgavidVersionMismatch "[MGA] верÑÑ–Ñ Ð´Ñ€Ð°Ð¹Ð²ÐµÑ€Ñƒ mga_vid Ñдра (%u) та MPlayer (%u) не Ñпівпадають\n" +// vo_null.c +#define MSGTR_LIBVO_NULL_UnknownSubdevice "[VO_NULL] Ðевідомий підприÑтрій: %s.\n" + +// vo_png.c +#define MSGTR_LIBVO_PNG_Warning1 "[VO_PNG] ПопередженнÑ: рівень ÑтиÑÐ½ÐµÐ½Ð½Ñ Ð²Ñтановлено 0, ÑтиÑÐ½ÐµÐ½Ð½Ñ Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð¾!\n" +#define MSGTR_LIBVO_PNG_Warning2 "[VO_PNG] Інфо: ВикориÑтайте -vo png:z= щоб вÑтановити рівень ÑтиÑÐ½ÐµÐ½Ð½Ñ Ð· 0 до 9.\n" +#define MSGTR_LIBVO_PNG_Warning3 "[VO_PNG] Інфо: (0 = без ÑтиÑненнÑ, 1 = найшвидша, найповільніша - 9 але найкраще ÑтиÑненнÑ)\n" +#define MSGTR_LIBVO_PNG_ErrorOpeningForWriting "\n[VO_PNG] Помилка при відкритті '%s' Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу!\n" +#define MSGTR_LIBVO_PNG_ErrorInCreatePng "[VO_PNG] Помилка при Ñтворенні png.\n" + +// vo_pnm.c +#define MSGTR_VO_PNM_ASCIIMode "Режим ASCII увімкнено." +#define MSGTR_VO_PNM_RawMode "Режим Raw увімкнено." +#define MSGTR_VO_PNM_PPMType "Запише файли PPM." +#define MSGTR_VO_PNM_PGMType "Запише файли PGM." +#define MSGTR_VO_PNM_PGMYUVType "Запише файли PGMYUV." + +// vo_sdl.c +#define MSGTR_LIBVO_SDL_CouldntGetAnyAcceptableSDLModeForOutput "[VO_SDL] Ðе можу вивеÑти прийнÑтний SDL Mode.\n" +#define MSGTR_LIBVO_SDL_SetVideoModeFailed "[VO_SDL] set_video_mode: Збій SDL_SetVideoMode: %s.\n" +#define MSGTR_LIBVO_SDL_SetVideoModeFailedFull "[VO_SDL] Set_fullmode: Збій SDL_SetVideoMode: %s.\n" +#define MSGTR_LIBVO_SDL_MappingI420ToIYUV "[VO_SDL] Показую I420 у IYUV.\n" +#define MSGTR_LIBVO_SDL_UnsupportedImageFormat "[VO_SDL] Формат картинки не підтримуєтьÑÑ (0x%X).\n" +#define MSGTR_LIBVO_SDL_InfoPleaseUseVmOrZoom "[VO_SDL] Інфо - Ñпробуйте -vm чи -zoom щоб перейти до найкращої роздільної здатноÑÑ‚Ñ–.\n" +#define MSGTR_LIBVO_SDL_FailedToSetVideoMode "[VO_SDL] Ðе вдалоÑÑ Ð²Ñтановити відео режим: %s.\n" +#define MSGTR_LIBVO_SDL_CouldntCreateAYUVOverlay "[VO_SDL] Ðе вдалоÑÑ Ñтворити оверлей YUV: %s.\n" +#define MSGTR_LIBVO_SDL_CouldntCreateARGBSurface "[VO_SDL] Ðе вдалоÑÑ Ñтворити поверхню RGB: %s.\n" +#define MSGTR_LIBVO_SDL_UsingDepthColorspaceConversion "[VO_SDL] ВикориÑтовую Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð³Ð»Ð¸Ð±Ð¸Ð½Ð¸/кольорового проÑтору, це уповільнить Ð¿Ñ€Ð¾Ñ‚Ñ–ÐºÐ°Ð½Ð½Ñ Ð¿Ñ€Ð¾Ñ†ÐµÑу (%ibpp -> %ibpp).\n" +#define MSGTR_LIBVO_SDL_UnsupportedImageFormatInDrawslice "[VO_SDL] Формат картинки не підтримуєтьÑÑ Ñƒ draw_slice, повідомте розробників MPlayer!\n" +#define MSGTR_LIBVO_SDL_BlitFailed "[VO_SDL] Збій Blit: %s.\n" +#define MSGTR_LIBVO_SDL_InitializationFailed "[VO_SDL] ІніціÑÐ»Ñ–Ð·Ð°Ñ†Ñ–Ñ SDL не вдалаÑÑ: %s.\n" +#define MSGTR_LIBVO_SDL_UsingDriver "[VO_SDL] ВикориÑтовую драйвер: %s.\n" + +// vo_svga.c +#define MSGTR_LIBVO_SVGA_ForcedVidmodeNotAvailable "[VO_SVGA] ФорÑований vid_mode %d (%s) не доÑтупний.\n" +#define MSGTR_LIBVO_SVGA_ForcedVidmodeTooSmall "[VO_SVGA] ФорÑований vid_mode %d (%s) замалий.\n" +#define MSGTR_LIBVO_SVGA_Vidmode "[VO_SVGA] Vid_mode: %d, %dx%d %dbpp.\n" +#define MSGTR_LIBVO_SVGA_VgasetmodeFailed "[VO_SVGA] Збій Vga_setmode(%d).\n" +#define MSGTR_LIBVO_SVGA_VideoModeIsLinearAndMemcpyCouldBeUsed "[VO_SVGA] Режим Відео лінійний та Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ´Ð°Ñ‡Ñ– Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð¼Ð¾Ð¶Ðµ бути\nвикориÑтаний memcpy.\n" +#define MSGTR_LIBVO_SVGA_VideoModeHasHardwareAcceleration "[VO_SVGA] Режим Відео має апаратне приÑÐºÐ¾Ñ€ÐµÐ½Ð½Ñ Ñ‚Ð¾Ð¼Ñƒ може бути кокориÑтаний put_image.\n" +#define MSGTR_LIBVO_SVGA_IfItWorksForYouIWouldLikeToKnow "[VO_SVGA] Якщо це працює у ваÑ, дайте мені знати.\n[VO_SVGA] (надішліть лоґ з `mplayer test.avi -v -v -v -v &> svga.log`). ДÑкую!\n" +#define MSGTR_LIBVO_SVGA_VideoModeHas "[VO_SVGA] Режим Відео має %d Ñторінку(ок/ки).\n" +#define MSGTR_LIBVO_SVGA_CenteringImageStartAt "[VO_SVGA] Centering image. Starting at (%d,%d)\n" +#define MSGTR_LIBVO_SVGA_UsingVidix "[VO_SVGA] ВикориÑтовую VIDIX. w=%i h=%i mw=%i mh=%i\n" + +// vo_tdfx_vid.c +#define MSGTR_LIBVO_TDFXVID_Move "[VO_TDXVID] Переміщую %d(%d) x %d => %d.\n" +#define MSGTR_LIBVO_TDFXVID_AGPMoveFailedToClearTheScreen "[VO_TDFXVID] ÐŸÐµÑ€ÐµÐ¼Ñ–Ñ‰ÐµÐ½Ð½Ñ AGP не вдалоÑÑ Ð¾Ñ‡Ð¸Ñтити екран.\n" +#define MSGTR_LIBVO_TDFXVID_BlitFailed "[VO_TDFXVID] Збій Blit.\n" +#define MSGTR_LIBVO_TDFXVID_NonNativeOverlayFormatNeedConversion "[VO_TDFXVID] ÐеÑтандартний формат оверлею потребує перетвореннÑ.\n" +#define MSGTR_LIBVO_TDFXVID_UnsupportedInputFormat "[VO_TDFXVID] Формат вводу 0x%x не підтримуєтьÑÑ.\n" +#define MSGTR_LIBVO_TDFXVID_OverlaySetupFailed "[VO_TDFXVID] Ð’ÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð¾Ð²ÐµÑ€Ð»ÐµÑŽ не вдалоÑÑ.\n" +#define MSGTR_LIBVO_TDFXVID_OverlayOnFailed "[VO_TDFXVID] Помилка оверлею.\n" +#define MSGTR_LIBVO_TDFXVID_OverlayReady "[VO_TDFXVID] Оверлей готовий: %d(%d) x %d @ %d => %d(%d) x %d @ %d.\n" +#define MSGTR_LIBVO_TDFXVID_TextureBlitReady "[VO_TDFXVID] Blit текÑтур готовий: %d(%d) x %d @ %d => %d(%d) x %d @ %d.\n" +#define MSGTR_LIBVO_TDFXVID_OverlayOffFailed "[VO_TDFXVID] Ð’Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð½Ñ Ð¾Ð²ÐµÑ€Ð»ÐµÑŽ не вдолоÑÑ\n" +#define MSGTR_LIBVO_TDFXVID_CantOpen "[VO_TDFXVID] Ðе можу відкрити %s: %s.\n" +#define MSGTR_LIBVO_TDFXVID_CantGetCurrentCfg "[VO_TDFXVID] Ðе можу отримати поточну конфігурацію: %s.\n" +#define MSGTR_LIBVO_TDFXVID_MemmapFailed "[VO_TDFXVID] Збій memmap !!!!!\n" +#define MSGTR_LIBVO_TDFXVID_GetImageTodo "Треба доробити картинку.\n" +#define MSGTR_LIBVO_TDFXVID_AgpMoveFailed "[VO_TDFXVID] ÐŸÐµÑ€ÐµÐ¼Ñ–Ñ‰ÐµÐ½Ð½Ñ AGP не вдалоÑÑ.\n" +#define MSGTR_LIBVO_TDFXVID_SetYuvFailed "[VO_TDFXVID] Ð’ÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ YUV не вдалоÑÑ.\n" +#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnYPlane "[VO_TDFXVID] ÐŸÐµÑ€ÐµÐ¼Ñ–Ñ‰ÐµÐ½Ð½Ñ AGP не вдалоÑÑ Ð½Ð° проєкції Y.\n" +#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnUPlane "[VO_TDFXVID] ÐŸÐµÑ€ÐµÐ¼Ñ–Ñ‰ÐµÐ½Ð½Ñ AGP не вдалоÑÑ Ð½Ð° проєкції U.\n" +#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnVPlane "[VO_TDFXVID] ÐŸÐµÑ€ÐµÐ¼Ñ–Ñ‰ÐµÐ½Ð½Ñ AGP не вдалоÑÑ Ð½Ð° проєкції V.\n" +#define MSGTR_LIBVO_TDFXVID_UnknownFormat "[VO_TDFXVID] невідомий формат: 0x%x.\n" + +// vo_tdfxfb.c +#define MSGTR_LIBVO_TDFXFB_CantOpen "[VO_TDFXFB] Ðе можу відкрити %s: %s.\n" +#define MSGTR_LIBVO_TDFXFB_ProblemWithFbitgetFscreenInfo "[VO_TDFXFB] Проблема з FBITGET_FSCREENINFO ioctl: %s.\n" +#define MSGTR_LIBVO_TDFXFB_ProblemWithFbitgetVscreenInfo "[VO_TDFXFB] Проблема з FBITGET_VSCREENINFO ioctl: %s.\n" +#define MSGTR_LIBVO_TDFXFB_ThisDriverOnlySupports "[VO_TDFXFB] Це драйвер підтримує тільки 3Dfx Banshee, Voodoo3 та Voodoo 5.\n" +#define MSGTR_LIBVO_TDFXFB_OutputIsNotSupported "[VO_TDFXFB] %d вивід bpp не підтримуєтьÑÑ.\n" +#define MSGTR_LIBVO_TDFXFB_CouldntMapMemoryAreas "[VO_TDFXFB] Ðе можу показати чаÑтини пам'ÑÑ‚Ñ–: %s.\n" +#define MSGTR_LIBVO_TDFXFB_BppOutputIsNotSupported "[VO_TDFXFB] %d вивід bpp не підтримуєтьÑÑ (Цього зовÑім не повинно траплÑтиÑÑ).\n" +#define MSGTR_LIBVO_TDFXFB_SomethingIsWrongWithControl "[VO_TDFXFB] Ой! ЩоÑÑŒ ÑталоÑÑ Ð· control().\n" +#define MSGTR_LIBVO_TDFXFB_NotEnoughVideoMemoryToPlay "[VO_TDFXFB] Ðе доÑтатньо пам'ÑÑ‚Ñ– щоб програти це відео. Спробуйте меншу роздільну здатніÑÑ‚ÑŒ.\n" +#define MSGTR_LIBVO_TDFXFB_ScreenIs "[VO_TDFXFB] Екран %dx%d на %d bpp, у %dx%d на %d bpp, режим %dx%d.\n" + +// vo_tga.c +#define MSGTR_LIBVO_TGA_UnknownSubdevice "[VO_TGA] Ðевідомий підприÑтрій: %s.\n" + +// vo_vesa.c +#define MSGTR_LIBVO_VESA_FatalErrorOccurred "[VO_VESA] Виникла фатально помилка! Ðе можу продовжити.\n" +#define MSGTR_LIBVO_VESA_UnknownSubdevice "[VO_VESA] невідомий підприÑтрій: '%s'.\n" +#define MSGTR_LIBVO_VESA_YouHaveTooLittleVideoMemory "[VO_VESA] Замало відео пам'ÑÑ‚Ñ– Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ режиму:\n[VO_VESA] Потребує: %08lX Ñ”: %08lX.\n" +#define MSGTR_LIBVO_VESA_YouHaveToSpecifyTheCapabilitiesOfTheMonitor "[VO_VESA] Ви маєте вказати можливоÑÑ‚Ñ– монітора. Ðе змінюю чаÑтому оновленнÑ.\n" +#define MSGTR_LIBVO_VESA_UnableToFitTheMode "[VO_VESA] Режим не відповідає обмеженнÑм монітора. Ðе змінюю чаÑтому оновленнÑ.\n" +#define MSGTR_LIBVO_VESA_DetectedInternalFatalError "[VO_VESA] ВиÑвлена фатальна Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°: init викликаний перед preinit.\n" +#define MSGTR_LIBVO_VESA_SwitchFlipIsNotSupported "[VO_VESA] ÐžÐ¿Ñ†Ñ–Ñ -flip не підтримуєтьÑÑ.\n" +#define MSGTR_LIBVO_VESA_PossibleReasonNoVbe2BiosFound "[VO_VESA] Можлива причина: Ðе знайдено VBE2 BIOS.\n" +#define MSGTR_LIBVO_VESA_FoundVesaVbeBiosVersion "[VO_VESA] Знайдено VESA VBE BIOS, верÑÑ–Ñ %x.%x ревізіÑ: %x.\n" +#define MSGTR_LIBVO_VESA_VideoMemory "[VO_VESA] Відео пам'ÑÑ‚ÑŒ: %u Кб.\n" +#define MSGTR_LIBVO_VESA_Capabilites "[VO_VESA] МожливоÑÑ‚Ñ– VESA: %s %s %s %s %s.\n" +#define MSGTR_LIBVO_VESA_BelowWillBePrintedOemInfo "[VO_VESA] !!! OEM Ñ–Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ Ð±ÑƒÐ´Ðµ виведена нище !!!\n" +#define MSGTR_LIBVO_VESA_YouShouldSee5OemRelatedLines "[VO_VESA] Ви повинні бачити 5 Ñ€Ñдків інфо про OEM нище; Якщо ні, у Ð²Ð°Ñ Ð¿Ð¾Ð»Ð°Ð¼Ð°Ð½Ð° vm86.\n" +#define MSGTR_LIBVO_VESA_OemInfo "[VO_VESA] OEM інфо: %s.\n" +#define MSGTR_LIBVO_VESA_OemRevision "[VO_VESA] OEM ревізіÑ: %x.\n" +#define MSGTR_LIBVO_VESA_OemVendor "[VO_VESA] OEM поÑтачальник: %s.\n" +#define MSGTR_LIBVO_VESA_OemProductName "[VO_VESA] Ðазва продукту OEM: %s.\n" +#define MSGTR_LIBVO_VESA_OemProductRev "[VO_VESA] Ð ÐµÐ²Ñ–Ð·Ñ–Ñ Ð¿Ñ€Ð¾Ð´ÑƒÐºÑ‚Ñƒ OEM: %s.\n" +#define MSGTR_LIBVO_VESA_Hint "[VO_VESA] Підказка: Ð”Ð»Ñ Ñ€Ð¾Ð±Ð¾Ñ‚Ð¸ ТБ-виходу вам необхідно підключити ТБ роз'єм\n"\ +"[VO_VESA] перед завантаженнÑм Ñк VESA BIOS ініціÑлізує Ñебе протÑгом POST.\n" +#define MSGTR_LIBVO_VESA_UsingVesaMode "[VO_VESA] ВикориÑтовую режим VESA (%u) = %x [%ux%u@%u]\n" +#define MSGTR_LIBVO_VESA_CantInitializeSwscaler "[VO_VESA] Ðе можу ініціÑлізувати програмне маÑштабуваннÑ.\n" +#define MSGTR_LIBVO_VESA_CantUseDga "[VO_VESA] Ðе можу викориÑтовувати DGA. ФорÑую режим комутації Ñегментів. :(\n" +#define MSGTR_LIBVO_VESA_UsingDga "[VO_VESA] ВикориÑтовую DGA (фізичні реÑурÑи: %08lXh, %08lXh)" +#define MSGTR_LIBVO_VESA_CantUseDoubleBuffering "[VO_VESA] Ðе можу викориÑтати подвійну буферизацію: не доÑтатньо відео пам'ÑÑ‚Ñ–.\n" +#define MSGTR_LIBVO_VESA_CantFindNeitherDga "[VO_VESA] Ðе можу знайти ні DGA ні переміщуваного фрейму вікна.\n" +#define MSGTR_LIBVO_VESA_YouveForcedDga "[VO_VESA] Ви форÑували DGA. Виходжу\n" +#define MSGTR_LIBVO_VESA_CantFindValidWindowAddress "[VO_VESA] Ðе можу знайти правильну адреÑу вікна.\n" +#define MSGTR_LIBVO_VESA_UsingBankSwitchingMode "[VO_VESA] ВикориÑтовую режим комутації Ñегментів (фізичні реÑурÑи: %08lXh, %08lXh).\n" +#define MSGTR_LIBVO_VESA_CantAllocateTemporaryBuffer "[VO_VESA] Ðе можу виділити тимчаÑовий буфер.\n" +#define MSGTR_LIBVO_VESA_SorryUnsupportedMode "[VO_VESA] Вибачте, режим не підтримуєтьÑÑ -- Ñпробуйте -x 640 -zoom.\n" +#define MSGTR_LIBVO_VESA_OhYouReallyHavePictureOnTv "[VO_VESA] О, ви Ñправді маєте картинку на ТБ!\n" +#define MSGTR_LIBVO_VESA_CantInitialozeLinuxVideoOverlay "[VO_VESA] Ðе можу ініціÑлізувати Відео оверлей Linux.\n" +#define MSGTR_LIBVO_VESA_UsingVideoOverlay "[VO_VESA] ВикориÑтовую відео оверлей: %s.\n" +#define MSGTR_LIBVO_VESA_CantInitializeVidixDriver "[VO_VESA] Ðе можу ініціÑлізувати драйвер VIDIX.\n" +#define MSGTR_LIBVO_VESA_UsingVidix "[VO_VESA] ВикориÑтовую VIDIX.\n" +#define MSGTR_LIBVO_VESA_CantFindModeFor "[VO_VESA] Ðе можу знайти режим длÑ: %ux%u@%u.\n" +#define MSGTR_LIBVO_VESA_InitializationComplete "[VO_VESA] ІніціÑÐ»Ñ–Ð·Ð°Ñ†Ñ–Ñ VESA завершена.\n" + // open.c, stream.c: #define MSGTR_CdDevNotfound "Компактовід \"%s\" не знайдений!\n" #define MSGTR_ErrTrackSelect "Помилка вибору треку на VCD!" From e633583d8cbc9e183aabf7aff6cf82c07df848bf Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 9 Mar 2009 20:56:19 +0000 Subject: [PATCH 60/89] libmpdemux/nuppelvideo.h was removed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28922 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Copyright | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Copyright b/Copyright index 47ae48b2d0..b80a81270d 100644 --- a/Copyright +++ b/Copyright @@ -154,7 +154,7 @@ License: GNU General Public License Name: NuppelVideo / RTJPEG Version: 0.52a + patches Homepage: http://web.archive.org/web/20060219034716/http://frost.htu.tuwien.ac.at/~roman/nuppelvideo/ -Directory: libmpcodecs/native/rtjpegn.[ch] libmpdemux/nuppelvideo.h +Directory: libmpcodecs/native/rtjpegn.[ch] Copyright: 1998 Justin Schoeman (justin@suntiger.ee.up.ac.za) 1998, 1999 Joerg Walter 1999 Wim Taymans From a06215d67ad6b5669d3e7a8d4bc2d0bdddc8dbf1 Mon Sep 17 00:00:00 2001 From: kraymer Date: Mon, 9 Mar 2009 21:31:36 +0000 Subject: [PATCH 61/89] typo git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28923 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/tech/mingw-crosscompile.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DOCS/tech/mingw-crosscompile.txt b/DOCS/tech/mingw-crosscompile.txt index 55beda7b9a..e4e2dbee0e 100644 --- a/DOCS/tech/mingw-crosscompile.txt +++ b/DOCS/tech/mingw-crosscompile.txt @@ -2,7 +2,8 @@ Due to a lack of Windows developers, it is a good idea to allow Linux developers to do at least some basic check of their code. This HOWTO explains how to set up MinGW cross-compilation under Debian. -First, you need to install the "mingw32" package and get a MPlayer SVN checkou. +First, you need to install the "mingw32" package and get a MPlayer SVN +checkout. Next, you need quite a lot of dependencies. Since this is for testing and not actually use, the easiest way is to use this package: From 6040551ed4864a7d459128307c943aa5244a15cd Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 9 Mar 2009 21:40:20 +0000 Subject: [PATCH 62/89] GraphEdit is also available in the Microsoft SDK nowadays. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28924 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/tech/win32-codec-howto.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DOCS/tech/win32-codec-howto.txt b/DOCS/tech/win32-codec-howto.txt index 81dfafca83..07930c20cd 100644 --- a/DOCS/tech/win32-codec-howto.txt +++ b/DOCS/tech/win32-codec-howto.txt @@ -53,7 +53,7 @@ New Method: Using Microsoft GraphEdit (fast) -- Get GraphEdit from either DirectX SDK or doom9. +- Get GraphEdit from the Microsoft SDK, DirectX SDK or doom9. - Start 'graphedit.exe'. - From the menu select "Graph -> Insert Filters". - Expand item "DirectShow Filters". From ab1163d8c5ac58dbbd9567349598e81e704bbe37 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 9 Mar 2009 23:15:26 +0000 Subject: [PATCH 63/89] cosmetics: Add newlines for better readability, rename Homepage entry to URL. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28925 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Copyright | 53 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/Copyright b/Copyright index b80a81270d..c4f2659183 100644 --- a/Copyright +++ b/Copyright @@ -9,22 +9,24 @@ from several external sources: Name: FFmpeg Version: Subversion HEAD -Homepage: http://www.ffmpeg.org +URL: http://www.ffmpeg.org Directory: libavcodec, libavformat, libavutil, libpostproc Copyright: Many, see individual files for copyright notices. License: GNU Lesser General Public License, some parts GNU General Public License, GNU General Public License when combined + Name: FAAD2 Version: 2.1 beta (20040915 CVS snapshot) + fixes and portability patches -Homepage: http://www.audiocoding.com +URL: http://www.audiocoding.com Directory: libfaad2 Copyright: 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com License: GNU General Public License + Name: GSM 06.10 library Version: patchlevel 10 -Homepage: http://kbs.cs.tu-berlin.de/~jutta/toast.html +URL: http://kbs.cs.tu-berlin.de/~jutta/toast.html Directory: libmpcodecs/native/ Copyright: 1992 by Jutta Degener and Carsten Bormann, TU Berlin License: permissive, see libmpcodecs/native/xa_gsm.c @@ -32,7 +34,7 @@ License: permissive, see libmpcodecs/native/xa_gsm.c Name: liba52 Version: 0.7.4 + patches -Homepage: http://liba52.sourceforge.net/ +URL: http://liba52.sourceforge.net/ Directory: liba52 Copyright: 1999-2000 Aaron Holtzman 2000-2001 Michel Lespinasse @@ -41,13 +43,15 @@ Copyright: 1999-2000 Aaron Holtzman 2004 Romain Dolbeau License: GNU General Public License + Name: libdvdcss Version: 1.2.10 -Homepage: http://developers.videolan.org/libdvdcss/ +URL: http://developers.videolan.org/libdvdcss/ Directory: libdvdcss Copyright: 1998-2008 VideoLAN License: GNU General Public License + Name: libdvdread Version: 0.9.7 + patches Homepage: http://www.dtek.chalmers.se/groups/dvd/development.shtml @@ -60,9 +64,10 @@ Copyright: 1998, 1999 Eric Smith 2000-2003 HÃ¥kan Hjort License: GNU General Public License + Name: libmpeg2 Version: 0.5.1 + patches -Homepage: http://libmpeg2.sourceforge.net/ +URL: http://libmpeg2.sourceforge.net/ Directory: libmpeg2 Copyright: 1999-2000 Aaron Holtzman 2000-2004 Michel Lespinasse @@ -72,25 +77,28 @@ Copyright: 1999-2000 Aaron Holtzman 2003 Peter Gubanov License: GNU General Public License + Name: mpg123 Version: 0.59s + significant changes -Homepage: http://www.mpg123.de/ +URL: http://www.mpg123.de/ Directory: mp3lib Copyright: 1995-1999 by Michael Hipp 2004 Romain Dolbeau 2006 Zuxy Meng License: GNU General Public License + Name: librtsp Version: xine CVS 2003/04/10 + patches -Homepage: http://www.xinehq.de +URL: http://www.xinehq.de Directory: stream/librtsp/ Copyright: 2000-2002 the xine project License: GNU General Public License + Name: realrtsp Version: xine CVS 2003/04/17 + patches -Homepage: http://www.xinehq.de +URL: http://www.xinehq.de Directory: stream/realrtsp/ Copyright: 2002 the xine project License: GNU General Public License + Name: pnm protocol implementation Version: xine CVS 2002/12/26 + patches -Homepage: http://www.xinehq.de +URL: http://www.xinehq.de Directory: stream/pnm.[ch] Copyright: 2000-2002 the xine project License: GNU General Public License + Name: id3edit Version: 1.9 + patches -Homepage: http://id3edit.sourceforge.net/ +URL: http://id3edit.sourceforge.net/ Directory: libmpdemux/genres.h Copyright: 2001 Jason Carter License: GNU General Public License + Name: FreeSDP Version: 0.4.1 -Homepage: https://savannah.nongnu.org/projects/freesdp/ +URL: https://savannah.nongnu.org/projects/freesdp/ Directory: stream/freesdp/ Copyright: 2001-2003 Federico Montesino Pouzols License: GNU General Public License + Name: MJPEG Tools Version: post 2001-12-03 release or CVS snapshot -Homepage: http://mjpeg.sourceforge.net/ +URL: http://mjpeg.sourceforge.net/ Directory: libmpdemux/yuv4mpeg* Copyright: 2001 Matthew J. Marjanovic 2001 Andrew Stevens License: GNU General Public License + Name: NuppelVideo / RTJPEG Version: 0.52a + patches -Homepage: http://web.archive.org/web/20060219034716/http://frost.htu.tuwien.ac.at/~roman/nuppelvideo/ +URL: http://web.archive.org/web/20060219034716/http://frost.htu.tuwien.ac.at/~roman/nuppelvideo/ Directory: libmpcodecs/native/rtjpegn.[ch] Copyright: 1998 Justin Schoeman (justin@suntiger.ee.up.ac.za) 1998, 1999 Joerg Walter 1999 Wim Taymans License: GNU General Public License + Name: ReactOS Version: r25937 -Homepage: http://www.reactos.org/ +URL: http://www.reactos.org/ Directory: vidix/dhahelperwin/ntverp.h vidix/dhahelperwin/common.ver Copyright: Alex Ionescu (alex.ionescu@reactos.org) License: GNU General Public License From fa60631a76710d0ef50e840cc5046e216eace74c Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 9 Mar 2009 23:19:16 +0000 Subject: [PATCH 64/89] Update entry for libdvdread; add entry for libdvdnav. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28926 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Copyright | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Copyright b/Copyright index c4f2659183..8d45d26b1a 100644 --- a/Copyright +++ b/Copyright @@ -53,15 +53,25 @@ License: GNU General Public License Name: libdvdread -Version: 0.9.7 + patches -Homepage: http://www.dtek.chalmers.se/groups/dvd/development.shtml -Directory: libdvdread +Version: Subversion HEAD +URL: svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdread/src +Directory: libdvdread4 Copyright: 1998, 1999 Eric Smith 1999 Christian Wolff for convergence integrated media - 2000-2001 Billy Biggs , + 2000-2004 Billy Biggs , 2001-2002 Samuel Hocevar , - 2000-2003 Björn Englund , - 2000-2003 HÃ¥kan Hjort + 2000-2004 Björn Englund , + 2000-2004 HÃ¥kan Hjort +License: GNU General Public License + + +Name: libdvdnav +Version: Subversion HEAD from +URL: svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdnav/src +Directory: libdvdnav +Copyright: 2000, 2001 Martin Norbäck, HÃ¥kan Hjort + 2000-2004 Rich Wareham + 2001-2004 the dvdnav project License: GNU General Public License From 919793e643612389a79d580c5306c1d4e991d0d4 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Mon, 9 Mar 2009 23:46:28 +0000 Subject: [PATCH 65/89] Output number of reference frames before creating H264 vdpau decoder. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28927 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_vdpau.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c index 4e0194493e..f7f2450751 100644 --- a/libvo/vo_vdpau.c +++ b/libvo/vo_vdpau.c @@ -786,6 +786,7 @@ static int draw_slice(uint8_t *image[], int stride[], int w, int h, break; case IMGFMT_VDPAU_H264: vdp_decoder_profile = VDP_DECODER_PROFILE_H264_HIGH; + mp_msg(MSGT_VO, MSGL_V, "[vdpau] Creating H264 hardware decoder for %d reference frames.\n", max_refs); break; case IMGFMT_VDPAU_WMV3: vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_MAIN; From cae648825521d65effff0fd371e142a8dc2d9cca Mon Sep 17 00:00:00 2001 From: compn Date: Tue, 10 Mar 2009 02:21:49 +0000 Subject: [PATCH 66/89] typo nuppelvideo spotted by kostya git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28928 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index c78a4b4f48..9ba2a627a1 100644 --- a/Changelog +++ b/Changelog @@ -37,7 +37,7 @@ MPlayer (1.0) * Brooktree YUV 4:1:1 Raw (Y41P) via binary DLL * many rare/obscure fourccs for known formats added * lower priority for binary Linux rv3040 codecs due to bugs - * remove native NuppleVideo decoder, use lavc instead + * remove native NuppelVideo decoder, use lavc instead Demuxers: * -lavfdopts cryptokey allows decrypting MXF and ASF files @@ -56,7 +56,7 @@ MPlayer (1.0) * support seeking in multirate RealMedia files * FLAC speedup in lavf demuxer * MNG demuxer - * remove native NuppleVideo demuxer, use lavf demuxer instead + * remove native NuppelVideo demuxer, use lavf demuxer instead Filters: * vf_ow new overcomplete wavelet denoiser From 143a63fd9eef49e84c26faf7644b032c8db79939 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 10 Mar 2009 10:05:09 +0000 Subject: [PATCH 67/89] Fix and restructure fastmemcpybench. It is now one binary that runs all available memcpy variants and prints benchmark results about them. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28929 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 22 +------ TOOLS/fastmem.sh | 21 ------ TOOLS/fastmemcpybench.c | 142 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 140 insertions(+), 45 deletions(-) delete mode 100755 TOOLS/fastmem.sh diff --git a/Makefile b/Makefile index b1ea48e963..feef5aba60 100644 --- a/Makefile +++ b/Makefile @@ -986,7 +986,7 @@ tests: $(addsuffix $(EXESUF),$(TESTS)) testsclean: -rm -f $(foreach file,$(TESTS),$(call ADD_ALL_EXESUFS,$(file))) -TOOLS = $(addprefix TOOLS/,alaw-gen asfinfo avi-fix avisubdump compare dump_mp4 movinfo netstream subrip vivodump) +TOOLS = $(addprefix TOOLS/,alaw-gen asfinfo avi-fix avisubdump compare dump_mp4 fastmemcpybench movinfo netstream subrip vivodump) ifdef ARCH_X86 TOOLS += TOOLS/modify_reg @@ -999,7 +999,7 @@ alltools: $(addsuffix $(EXESUF),$(ALLTOOLS)) toolsclean: -rm -f $(foreach file,$(ALLTOOLS),$(call ADD_ALL_EXESUFS,$(file))) - -rm -f TOOLS/fastmem-* TOOLS/realcodecs/*.so.6.0 + -rm -f TOOLS/realcodecs/*.so.6.0 TOOLS/bmovl-test$(EXESUF): -lSDL_image @@ -1016,27 +1016,11 @@ TOOLS/vivodump$(EXESUF): TOOLS/vivodump.c TOOLS/netstream$(EXESUF) TOOLS/vivodump$(EXESUF): $(subst mplayer.o,mplayer-nomain.o,$(OBJS_MPLAYER)) $(filter-out %mencoder.o,$(OBJS_MENCODER)) $(OBJS_COMMON) $(COMMON_LIBS) $(CC) $(CFLAGS) -o $@ $^ $(EXTRALIBS_MPLAYER) $(EXTRALIBS_MENCODER) $(COMMON_LDFLAGS) -TOOLS/fastmem-c$(EXESUF): CFLAGS += -DHAVE_MMX=0 -DHAVE_AMD3DNOW=0 -DHAVE_MMX2=0 -DHAVE_SSE=0 -DNAME=\"C\" -TOOLS/fastmem-mmx$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=0 -DHAVE_MMX2=0 -DHAVE_SSE=0 -DNAME=\"MMX\" -TOOLS/fastmem-k6$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=1 -DHAVE_MMX2=0 -DHAVE_SSE=0 -DNAME=\"K6\" -TOOLS/fastmem-k7$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=1 -DHAVE_MMX2=1 -DHAVE_SSE=0 -DNAME=\"K7\" -TOOLS/fastmem-sse$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=0 -DHAVE_MMX2=1 -DHAVE_SSE=1 -DNAME=\"SSE\" -TOOLS/fastmem-mga-mmx$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=0 -DHAVE_MMX2=0 -DHAVE_SSE=0 -DNAME=\"MGA-MMX\" -DCONFIG_MGA -TOOLS/fastmem-mga-k6$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=1 -DHAVE_MMX2=0 -DHAVE_SSE=0 -DNAME=\"MGA-K6\" -DCONFIG_MGA -TOOLS/fastmem-mga-k7$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=1 -DHAVE_MMX2=1 -DHAVE_SSE=0 -DNAME=\"MGA-K7\" -DCONFIG_MGA -TOOLS/fastmem-mga-sse$(EXESUF): CFLAGS += -DHAVE_MMX=1 -DHAVE_AMD3DNOW=0 -DHAVE_MMX2=1 -DHAVE_SSE=1 -DNAME=\"MGA-SSE\" -DCONFIG_MGA - -fastmemcpybench: $(addsuffix $(EXESUF),$(addprefix TOOLS/fastmem-,c mmx k6 k7 sse mga-mmx mga-k6 mga-k7 mga-sse)) - -TOOLS/fastmem-%$(EXESUF): TOOLS/fastmemcpybench.c libvo/aclib.c - $(CC) $(CFLAGS) -o $@ $^ - REAL_SRCS = $(wildcard TOOLS/realcodecs/*.c) REAL_TARGETS = $(REAL_SRCS:.c=.so.6.0) realcodecs: $(REAL_TARGETS) - -fastmemcpybench realcodecs: CFLAGS += -g +realcodecs: CFLAGS += -g %.so.6.0: %.o ld -shared -o $@ $< -ldl -lc diff --git a/TOOLS/fastmem.sh b/TOOLS/fastmem.sh deleted file mode 100755 index 1b8ff12793..0000000000 --- a/TOOLS/fastmem.sh +++ /dev/null @@ -1,21 +0,0 @@ - -sync -sleep 2 -./fastmem-k6 -sleep 2 -./fastmem-k7 -sleep 2 -./fastmem-mmx -sleep 2 -./fastmem-sse -sleep 2 -./fastmem-c -sleep 2 -./fastmem2-k6 -sleep 2 -./fastmem2-k7 -sleep 2 -./fastmem2-mmx -sleep 2 -./fastmem2-sse -sleep 2 diff --git a/TOOLS/fastmemcpybench.c b/TOOLS/fastmemcpybench.c index 48a29374c3..75eb70fc5b 100644 --- a/TOOLS/fastmemcpybench.c +++ b/TOOLS/fastmemcpybench.c @@ -7,8 +7,6 @@ * was not confirmed through testing. */ -/* According to Uoti this code is broken. */ - #include #include #include @@ -18,7 +16,92 @@ #include #include #include -#include "libvo/fastmemcpy.h" + +#include "config.h" +#include "cpudetect.h" + +#define BLOCK_SIZE 4096 +#define CONFUSION_FACTOR 0 + +#if HAVE_MMX +#define COMPILE_MMX +#endif + +#if HAVE_MMX2 +#define COMPILE_MMX2 +#endif + +#if HAVE_AMD3DNOW +#define COMPILE_AMD3DNOW +#endif + +#if HAVE_SSE +#define COMPILE_SSE +#endif + +#ifdef COMPILE_MMX +#undef RENAME +#undef HAVE_MMX +#undef HAVE_MMX2 +#undef HAVE_AMD3DNOW +#undef HAVE_SSE +#undef HAVE_SSE2 +#define HAVE_MMX 1 +#define HAVE_MMX2 0 +#define HAVE_AMD3DNOW 0 +#define HAVE_SSE 0 +#define HAVE_SSE2 0 +#define RENAME(a) a ## _MMX +#include "libvo/aclib_template.c" +#endif + +#ifdef COMPILE_MMX2 +#undef RENAME +#undef HAVE_MMX +#undef HAVE_MMX2 +#undef HAVE_AMD3DNOW +#undef HAVE_SSE +#undef HAVE_SSE2 +#define HAVE_MMX 1 +#define HAVE_MMX2 1 +#define HAVE_AMD3DNOW 0 +#define HAVE_SSE 0 +#define HAVE_SSE2 0 +#define RENAME(a) a ## _MMX2 +#include "libvo/aclib_template.c" +#endif + +#ifdef COMPILE_AMD3DNOW +#undef RENAME +#undef HAVE_MMX +#undef HAVE_MMX2 +#undef HAVE_AMD3DNOW +#undef HAVE_SSE +#undef HAVE_SSE2 +#define HAVE_MMX 1 +#define HAVE_MMX2 0 +#define HAVE_AMD3DNOW 1 +#define HAVE_SSE 0 +#define HAVE_SSE2 0 +#define RENAME(a) a ## _3DNow +#include "libvo/aclib_template.c" +#endif + +#ifdef COMPILE_SSE +#undef RENAME +#undef HAVE_MMX +#undef HAVE_MMX2 +#undef HAVE_AMD3DNOW +#undef HAVE_SSE +#undef HAVE_SSE2 +#define HAVE_MMX 1 +#define HAVE_MMX2 1 +#define HAVE_AMD3DNOW 0 +#define HAVE_SSE 1 +#define HAVE_SSE2 1 +#define RENAME(a) a ## _SSE +#include "libvo/aclib_template.c" +#endif //#define ARR_SIZE 100000 #define ARR_SIZE (1024*768*2) @@ -114,11 +197,60 @@ int main(void) t = GetTimer(); v1 = read_tsc(); for (i = 0; i < 100; i++) - fast_memcpy(marr1, marr2, ARR_SIZE - 16); + memcpy(marr1, marr2, ARR_SIZE - 16); v2 = read_tsc(); t = GetTimer() - t; // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t - printf(NAME ": CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, + printf("libc: CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); + +#if HAVE_MMX + t = GetTimer(); + v1 = read_tsc(); + for (i = 0; i < 100; i++) + fast_memcpy_MMX(marr1, marr2, ARR_SIZE - 16); + v2 = read_tsc(); + t = GetTimer() - t; + // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t + printf("MMX: CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, + 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); +#endif + +#if HAVE_AMD3DNOW + t = GetTimer(); + v1 = read_tsc(); + for (i = 0; i < 100; i++) + fast_memcpy_3DNow(marr1, marr2, ARR_SIZE - 16); + v2 = read_tsc(); + t = GetTimer() - t; + // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t + printf("3DNow!: CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, + 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); +#endif + +#if HAVE_MMX2 + t = GetTimer(); + v1 = read_tsc(); + for (i = 0; i < 100; i++) + fast_memcpy_MMX2(marr1, marr2, ARR_SIZE - 16); + v2 = read_tsc(); + t = GetTimer() - t; + // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t + printf("MMX2: CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, + 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); +#endif + +#if HAVE_SSE + t = GetTimer(); + v1 = read_tsc(); + for (i = 0; i < 100; i++) + fast_memcpy_SSE(marr1, marr2, ARR_SIZE - 16); + v2 = read_tsc(); + t = GetTimer() - t; + // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t + printf("SSE: CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, + 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); +#endif + return 0; } From 4e7827edeb16a3cb5398e0f2e5935ed4048a8ce9 Mon Sep 17 00:00:00 2001 From: compn Date: Tue, 10 Mar 2009 20:16:16 +0000 Subject: [PATCH 68/89] sn40 decodes with ffodivx git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28930 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/codecs.conf b/etc/codecs.conf index c824ab9903..83ff4562c0 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -883,7 +883,7 @@ videocodec ffodivx fourcc FFDS fourcc DCOD,MVXM,EM4A,PM4V fourcc M4T3,DMK2,DIGI,INMC - fourcc EPHV + fourcc EPHV,SN40 driver ffmpeg dll mpeg4 ;opendivx out YV12,I420,IYUV @@ -934,7 +934,7 @@ videocodec xvid fourcc FFDS fourcc DCOD,MVXM,EM4A,PM4V fourcc M4T3,DMK2,DIGI,INMC - fourcc EPHV + fourcc EPHV,SN40 format 0x10000004 ; mpeg 4 es driver xvid out YV12 From 842880eecbfa5cc9fafe634cd324acd5e3626512 Mon Sep 17 00:00:00 2001 From: compn Date: Tue, 10 Mar 2009 23:23:01 +0000 Subject: [PATCH 69/89] add sn40 binary codec git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28931 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 83ff4562c0..1b7dd58d22 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -525,6 +525,15 @@ videocodec theora ;WIN32: +videocodec smartsight + info "Verint Video Manager" + status working + fourcc SN40 + fourcc SN41,SJPG ; untested + driver vfw + dll "SN4Codec.dll" + out BGR24 flip + videocodec msuscls info "MSU Screen Capture Lossless Codec" status working From c2410d6cc9cf6e9084b559538bf9aa958ed47887 Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 11 Mar 2009 00:25:23 +0000 Subject: [PATCH 70/89] =?UTF-8?q?Update=20email=20address=20for=20Vajna,?= =?UTF-8?q?=20Mikl=C3=B3s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28932 b3059339-0415-0410-9bf9-f77b7e298cf2 --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index c54371a2c4..99f52fa8de 100644 --- a/AUTHORS +++ b/AUTHORS @@ -808,7 +808,7 @@ Ulion Urpala, Uoti (uau) * A/V sync fixes -Vajna, Miklós (VMiklos) +Vajna, Miklós (VMiklos) * TOOLS/divx2svcd author * TOOLS/ directory documentation From 7fee9f0101e0a196495a4980d78a4b09bd8f073c Mon Sep 17 00:00:00 2001 From: sdrik Date: Wed, 11 Mar 2009 14:22:53 +0000 Subject: [PATCH 71/89] In initMMX2HScaler, when chrDstW is not divisible by 4, the last filterPos element is initialized on the wrong index (not evenly aligned). This fixes it git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28933 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 1307a5076b..c6012c15b7 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1622,7 +1622,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil } xpos+=xInc; } - filterPos[i/2]= xpos>>16; // needed to jump to the next part + filterPos[((i/2)+1)&(~1)]= xpos>>16; // needed to jump to the next part } #endif /* COMPILE_MMX2 */ From 437ee8cc61365f43b09c4139bf15ded8ade43dc9 Mon Sep 17 00:00:00 2001 From: sdrik Date: Wed, 11 Mar 2009 14:44:22 +0000 Subject: [PATCH 72/89] Make MMX registers parametrized in the YSCALEYUV2PACKEDX_YA macro git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28934 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index da6278d80c..241aef4488 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -230,28 +230,28 @@ "test %%"REG_S", %%"REG_S" \n\t"\ " jnz 2b \n\t"\ -#define YSCALEYUV2PACKEDX_YA(offset) \ +#define YSCALEYUV2PACKEDX_YA(offset,coeff,src1,src2,dst1,dst2) \ "lea "offset"(%0), %%"REG_d" \n\t"\ "mov (%%"REG_d"), %%"REG_S" \n\t"\ - "movq "VROUNDER_OFFSET"(%0), %%mm1 \n\t"\ - "movq %%mm1, %%mm7 \n\t"\ + "movq "VROUNDER_OFFSET"(%0), "#dst1" \n\t"\ + "movq "#dst1", "#dst2" \n\t"\ ASMALIGN(4)\ "2: \n\t"\ - "movq 8(%%"REG_d"), %%mm0 \n\t" /* filterCoeff */\ - "movq (%%"REG_S", %%"REG_a", 2), %%mm2 \n\t" /* Y1srcData */\ - "movq 8(%%"REG_S", %%"REG_a", 2), %%mm5 \n\t" /* Y2srcData */\ + "movq 8(%%"REG_d"), "#coeff" \n\t" /* filterCoeff */\ + "movq (%%"REG_S", %%"REG_a", 2), "#src1" \n\t" /* Y1srcData */\ + "movq 8(%%"REG_S", %%"REG_a", 2), "#src2" \n\t" /* Y2srcData */\ "add $16, %%"REG_d" \n\t"\ "mov (%%"REG_d"), %%"REG_S" \n\t"\ - "pmulhw %%mm0, %%mm2 \n\t"\ - "pmulhw %%mm0, %%mm5 \n\t"\ - "paddw %%mm2, %%mm1 \n\t"\ - "paddw %%mm5, %%mm7 \n\t"\ + "pmulhw "#coeff", "#src1" \n\t"\ + "pmulhw "#coeff", "#src2" \n\t"\ + "paddw "#src1", "#dst1" \n\t"\ + "paddw "#src2", "#dst2" \n\t"\ "test %%"REG_S", %%"REG_S" \n\t"\ " jnz 2b \n\t"\ #define YSCALEYUV2PACKEDX \ YSCALEYUV2PACKEDX_UV \ - YSCALEYUV2PACKEDX_YA(LUM_MMX_FILTER_OFFSET) \ + YSCALEYUV2PACKEDX_YA(LUM_MMX_FILTER_OFFSET,%%mm0,%%mm2,%%mm5,%%mm1,%%mm7) \ #define YSCALEYUV2PACKEDX_END \ :: "r" (&c->redDither), \ From a0735f585933ca7834285fab5191ec867d9f936e Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 11 Mar 2009 22:55:23 +0000 Subject: [PATCH 73/89] Use ScaledBorderAndShadow: yes by default. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28935 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libass/ass.c b/libass/ass.c index 612c8d6aae..b0c38c2ce4 100644 --- a/libass/ass.c +++ b/libass/ass.c @@ -1128,6 +1128,7 @@ long long ass_step_sub(ass_track_t* track, long long now, int movement) { ass_track_t* ass_new_track(ass_library_t* library) { ass_track_t* track = calloc(1, sizeof(ass_track_t)); track->library = library; + track->ScaledBorderAndShadow = 1; track->parser_priv = calloc(1, sizeof(parser_priv_t)); return track; } From cb9716ac6e5d12a778f98030ca36b5403b7c12a2 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 12 Mar 2009 10:50:21 +0000 Subject: [PATCH 74/89] SSE3 support patch by Zhou Zongyi, zhouzongyi pset.suntec net git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28936 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cpudetect.c | 2 ++ cpudetect.h | 1 + 2 files changed, 3 insertions(+) diff --git a/cpudetect.c b/cpudetect.c index 5da169dfc0..84ae527089 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -143,6 +143,7 @@ void GetCpuCaps( CpuCaps *caps) caps->hasMMX = (regs2[3] & (1 << 23 )) >> 23; // 0x0800000 caps->hasSSE = (regs2[3] & (1 << 25 )) >> 25; // 0x2000000 caps->hasSSE2 = (regs2[3] & (1 << 26 )) >> 26; // 0x4000000 + caps->hasSSE3 = (regs2[2] & 1); // 0x0000001 caps->hasSSSE3 = (regs2[2] & (1 << 9 )) >> 9; // 0x0000200 caps->hasMMX2 = caps->hasSSE; // SSE cpus supports mmxext too cl_size = ((regs2[1] >> 8) & 0xFF)*8; @@ -458,6 +459,7 @@ void GetCpuCaps( CpuCaps *caps) caps->has3DNowExt=0; caps->hasSSE=0; caps->hasSSE2=0; + caps->hasSSE3=0; caps->hasSSSE3=0; caps->hasSSE4a=0; caps->isX86=0; diff --git a/cpudetect.h b/cpudetect.h index 2cc99d47eb..f31bf07dff 100644 --- a/cpudetect.h +++ b/cpudetect.h @@ -46,6 +46,7 @@ typedef struct cpucaps_s { int has3DNowExt; int hasSSE; int hasSSE2; + int hasSSE3; int hasSSSE3; int hasSSE4a; int isX86; From 4143892c3beef713a968d4db95f5f7ee8a0ea380 Mon Sep 17 00:00:00 2001 From: compn Date: Thu, 12 Mar 2009 11:16:51 +0000 Subject: [PATCH 75/89] add some info for acm and tips for searching git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28937 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/tech/win32-codec-howto.txt | 41 +++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/DOCS/tech/win32-codec-howto.txt b/DOCS/tech/win32-codec-howto.txt index 07930c20cd..3346de47bb 100644 --- a/DOCS/tech/win32-codec-howto.txt +++ b/DOCS/tech/win32-codec-howto.txt @@ -25,17 +25,36 @@ Cannot find codec matching selected -vo and video format 0x55594648. It means your AVI is encoded with a codec which has the HFYU fourcc (HFYU = HuffYUV codec, DIV3 = DivX Low Motion, etc.). Now that you know this, you -have to find out which DLL Windows loads in order to play this file. In our -case, the 'system.ini' contains this information in a line that reads: +have to find out which DLL Windows loads in order to play this file. +You can find the vfw codec by searching the internet for e.g. VIDC.HFYU. + +In our case, the 'system.ini' also contains this information in a line that reads: VIDC.HFYU=huffyuv.dll -So you need the 'huffyuv.dll' file. Note that the audio codecs are -specified by the MSACM prefix: +So you need the 'huffyuv.dll' file. + + + +ACM Codecs: +~~~~~~~~~~~~ +MPlayer may fail at playing the audio in your file with this message: + +Cannot find codec for audio format 0x55. +Read DOCS/HTML/en/codecs.html! +Audio: no sound + +MPlayer calls this the TwoCC format identifier. From the TwoCC list we find: + +0x0055 MPEG-1 Layer 3 (MP3) + +If you are lucky, you can then just search the internet for "codec acm" +e.g. "mp3 acm". Or if the codec is already installed on Windows, +it will show up in the system.ini as: msacm.l3acm=L3codeca.acm -This is the MP3 codec. +Note that the audio codecs are specified by the MSACM prefix: @@ -86,3 +105,15 @@ Take a deep breath and start searching the registry... If searching fails, try enabling all the checkboxes. You may have false hits, but you may get lucky... + + + +Tips: +~~~~~~~ +If you get an error loading a new codec, it may need some more files to work. +Start the filemon utility before loading MPlayer to find out which dlls are +trying to be loaded. + +Your codec may load some external .dll libraries. If the codec is already +installed in Windows, run listdlls wmplayer.exe while Windows Media +Player is playing your file to find out which. From e530d4b4673c745a3f48f750b9ecd628f1c929c9 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 12 Mar 2009 11:55:26 +0000 Subject: [PATCH 76/89] Replace duplicated code by a macro. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28938 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/fastmemcpybench.c | 61 +++++++++++------------------------------ 1 file changed, 16 insertions(+), 45 deletions(-) diff --git a/TOOLS/fastmemcpybench.c b/TOOLS/fastmemcpybench.c index 75eb70fc5b..35946d8b02 100644 --- a/TOOLS/fastmemcpybench.c +++ b/TOOLS/fastmemcpybench.c @@ -194,62 +194,33 @@ int main(void) for (i = 0; i < ARR_SIZE - 16; i++) marr1[i] = marr2[i] = i; - t = GetTimer(); - v1 = read_tsc(); - for (i = 0; i < 100; i++) - memcpy(marr1, marr2, ARR_SIZE - 16); - v2 = read_tsc(); - t = GetTimer() - t; - // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t - printf("libc: CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, - 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); +#define testblock(func, name) \ + t = GetTimer(); \ + v1 = read_tsc(); \ + for (i = 0; i < 100; i++) \ + func(marr1, marr2, ARR_SIZE - 16); \ + v2 = read_tsc(); \ + t = GetTimer() - t; \ + /* ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t */ \ + printf(name "CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, \ + 100000000.0f / (float)t, (float)ARR_SIZE*95.36743f / (float)t); + + testblock(memcpy, "libc: "); #if HAVE_MMX - t = GetTimer(); - v1 = read_tsc(); - for (i = 0; i < 100; i++) - fast_memcpy_MMX(marr1, marr2, ARR_SIZE - 16); - v2 = read_tsc(); - t = GetTimer() - t; - // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t - printf("MMX: CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, - 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); + testblock(fast_memcpy_MMX, "MMX: "); #endif #if HAVE_AMD3DNOW - t = GetTimer(); - v1 = read_tsc(); - for (i = 0; i < 100; i++) - fast_memcpy_3DNow(marr1, marr2, ARR_SIZE - 16); - v2 = read_tsc(); - t = GetTimer() - t; - // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t - printf("3DNow!: CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, - 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); + testblock(fast_memcpy_3DNow, "3DNow!: "); #endif #if HAVE_MMX2 - t = GetTimer(); - v1 = read_tsc(); - for (i = 0; i < 100; i++) - fast_memcpy_MMX2(marr1, marr2, ARR_SIZE - 16); - v2 = read_tsc(); - t = GetTimer() - t; - // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t - printf("MMX2: CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, - 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); + testblock(fast_memcpy_MMX2, "MMX2: "); #endif #if HAVE_SSE - t = GetTimer(); - v1 = read_tsc(); - for (i = 0; i < 100; i++) - fast_memcpy_SSE(marr1, marr2, ARR_SIZE - 16); - v2 = read_tsc(); - t = GetTimer() - t; - // ARR_SIZE*100 / (1024*1024) / (t/1000000) = ARR_SIZE*95.36743 / t - printf("SSE: CPU clocks=%llu = %dus (%5.3ffps) %5.1fMB/s\n", v2-v1, t, - 100000000.0f/(float)t, (float)ARR_SIZE*95.36743f/(float)t); + testblock(fast_memcpy_SSE, "SSE: "); #endif return 0; From db0be495091fa8b4cf64f5d0fb36a20d31fba232 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 13 Mar 2009 16:42:42 +0000 Subject: [PATCH 77/89] Fix compilation with --charset=noconv git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28939 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 4596a804f0..3ac7d16f15 100755 --- a/configure +++ b/configure @@ -7768,13 +7768,11 @@ fi #if test "$_gui" # --------------- GUI specific tests end ------------------- -if test "$_charset" = "noconv" ; then - _charset="" -fi -if test "$_charset" ; then +if test "$_charset" != "noconv" ; then def_charset="#define MSG_CHARSET \"$_charset\"" else def_charset="#undef MSG_CHARSET" + _charset="UTF-8" fi if test -n "$_charset" && test "$_charset" != "UTF-8" ; then From 2af2550175ced5cf5f4e8a3cd37f1940e5a49683 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 13 Mar 2009 17:02:15 +0000 Subject: [PATCH 78/89] Add missing ecx clobber in diff_MMX code (yes, that function is duplicated). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28940 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_decimate.c | 2 +- libmpcodecs/vf_divtc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpcodecs/vf_decimate.c b/libmpcodecs/vf_decimate.c index e1cea34ae3..676c97b2e3 100644 --- a/libmpcodecs/vf_decimate.c +++ b/libmpcodecs/vf_decimate.c @@ -55,7 +55,7 @@ static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns) "emms \n\t" : : "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out) - : "memory" + : "%ecx", "memory" ); return out[0]+out[1]+out[2]+out[3]; } diff --git a/libmpcodecs/vf_divtc.c b/libmpcodecs/vf_divtc.c index 1d55dc1eed..f84ae2e5a0 100644 --- a/libmpcodecs/vf_divtc.c +++ b/libmpcodecs/vf_divtc.c @@ -69,7 +69,7 @@ static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns) "emms \n\t" : : "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out) - : "memory" + : "%ecx", "memory" ); return out[0]+out[1]+out[2]+out[3]; } From f9f40364d70d86971199d946052e494b6bd96ba1 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 13 Mar 2009 17:09:39 +0000 Subject: [PATCH 79/89] Use the same code as in vf_decimate to select diff_MMX git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28941 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_divtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libmpcodecs/vf_divtc.c b/libmpcodecs/vf_divtc.c index f84ae2e5a0..f7baf61807 100644 --- a/libmpcodecs/vf_divtc.c +++ b/libmpcodecs/vf_divtc.c @@ -682,11 +682,10 @@ static int open(vf_instance_t *vf, char* args) if(!(p->history=calloc(sizeof *p->history, p->window))) goto nomem; - diff= + diff = diff_C; #if HAVE_MMX - gCpuCaps.hasMMX?diff_MMX: + if(gCpuCaps.hasMMX) diff = diff_MMX; #endif - diff_C; free(args); return 1; From 1f1b999cb94a1c98be13db954cba9ed3f41f6378 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 13 Mar 2009 17:12:40 +0000 Subject: [PATCH 80/89] Check for HAVE_EBX_AVAILABLE before enabling MMX code that needs the EBX register. Makes things a bit simpler for everyone who insists on compiling MPlayer as PIE-code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28942 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_decimate.c | 4 ++-- libmpcodecs/vf_divtc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmpcodecs/vf_decimate.c b/libmpcodecs/vf_decimate.c index 676c97b2e3..a6eb3dad5b 100644 --- a/libmpcodecs/vf_decimate.c +++ b/libmpcodecs/vf_decimate.c @@ -19,7 +19,7 @@ struct vf_priv_s { int max, last, cnt; }; -#if HAVE_MMX +#if HAVE_MMX && HAVE_EBX_AVAILABLE static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns) { volatile short out[4]; @@ -164,7 +164,7 @@ static int open(vf_instance_t *vf, char* args) p->frac = 0.33; if (args) sscanf(args, "%d:%d:%d:%f", &p->max, &p->hi, &p->lo, &p->frac); diff = diff_C; -#if HAVE_MMX +#if HAVE_MMX && HAVE_EBX_AVAILABLE if(gCpuCaps.hasMMX) diff = diff_MMX; #endif return 1; diff --git a/libmpcodecs/vf_divtc.c b/libmpcodecs/vf_divtc.c index f7baf61807..fa2918135e 100644 --- a/libmpcodecs/vf_divtc.c +++ b/libmpcodecs/vf_divtc.c @@ -33,7 +33,7 @@ struct vf_priv_s * diff_MMX and diff_C stolen from vf_decimate.c */ -#if HAVE_MMX +#if HAVE_MMX && HAVE_EBX_AVAILABLE static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns) { volatile short out[4]; @@ -683,7 +683,7 @@ static int open(vf_instance_t *vf, char* args) goto nomem; diff = diff_C; -#if HAVE_MMX +#if HAVE_MMX && HAVE_EBX_AVAILABLE if(gCpuCaps.hasMMX) diff = diff_MMX; #endif From 4acac0faf50449e071ee7557685b5f64ad4ea5ec Mon Sep 17 00:00:00 2001 From: sdrik Date: Sat, 14 Mar 2009 08:11:03 +0000 Subject: [PATCH 81/89] Make the source buffer operands parametrized in the YSCALEYUV2RGB_YA macro git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28943 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 241aef4488..80704f6eb6 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -458,11 +458,11 @@ "pmulhw "VG_COEFF"("#c"), %%mm4 \n\t"\ /* mm2=(U-128)8, mm3=ug, mm4=vg mm5=(V-128)8 */\ -#define REAL_YSCALEYUV2RGB_YA(index, c) \ - "movq (%0, "#index", 2), %%mm0 \n\t" /*buf0[eax]*/\ - "movq (%1, "#index", 2), %%mm1 \n\t" /*buf1[eax]*/\ - "movq 8(%0, "#index", 2), %%mm6 \n\t" /*buf0[eax]*/\ - "movq 8(%1, "#index", 2), %%mm7 \n\t" /*buf1[eax]*/\ +#define REAL_YSCALEYUV2RGB_YA(index, c, b1, b2) \ + "movq ("#b1", "#index", 2), %%mm0 \n\t" /*buf0[eax]*/\ + "movq ("#b2", "#index", 2), %%mm1 \n\t" /*buf1[eax]*/\ + "movq 8("#b1", "#index", 2), %%mm6 \n\t" /*buf0[eax]*/\ + "movq 8("#b2", "#index", 2), %%mm7 \n\t" /*buf1[eax]*/\ "psubw %%mm1, %%mm0 \n\t" /* buf0[eax] - buf1[eax]*/\ "psubw %%mm7, %%mm6 \n\t" /* buf0[eax] - buf1[eax]*/\ "pmulhw "LUM_MMX_FILTER_OFFSET"+8("#c"), %%mm0 \n\t" /* (buf0[eax] - buf1[eax])yalpha1>>16*/\ @@ -501,11 +501,11 @@ "packuswb %%mm6, %%mm5 \n\t"\ "packuswb %%mm3, %%mm4 \n\t"\ -#define YSCALEYUV2RGB_YA(index, c) REAL_YSCALEYUV2RGB_YA(index, c) +#define YSCALEYUV2RGB_YA(index, c, b1, b2) REAL_YSCALEYUV2RGB_YA(index, c, b1, b2) #define YSCALEYUV2RGB(index, c) \ REAL_YSCALEYUV2RGB_UV(index, c) \ - REAL_YSCALEYUV2RGB_YA(index, c) \ + REAL_YSCALEYUV2RGB_YA(index, c, %0, %1) \ REAL_YSCALEYUV2RGB_COEFF(c) #define REAL_YSCALEYUV2PACKED1(index, c) \ From bc4e834998995f37216b3d52f6d974409fc3e455 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 14 Mar 2009 12:32:28 +0000 Subject: [PATCH 82/89] Set DOCTYPE in xsl-generated HTML documentation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28944 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/html-common.xsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DOCS/xml/html-common.xsl b/DOCS/xml/html-common.xsl index dc3cb14cea..d803b3d1d4 100644 --- a/DOCS/xml/html-common.xsl +++ b/DOCS/xml/html-common.xsl @@ -2,7 +2,9 @@ - + @@ -69,8 +69,8 @@ codec name fourcc - codecfile - problem + driver name + comments @@ -87,8 +87,8 @@ codec name fourcc - codecfile - problem + driver name + comments @@ -111,7 +111,7 @@ codec name format - codecfile + driver name comments @@ -129,8 +129,8 @@ codec name format - codecfile - problem + driver name + comments @@ -147,8 +147,8 @@ codec name format - codecfile - problem + driver name + comments @@ -165,8 +165,8 @@ codec name format - codecfile - problem + driver name + comments From 2adaae35cf2c9beaad4ebf0a75fedf2ffe2733b1 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 14 Mar 2009 17:01:28 +0000 Subject: [PATCH 87/89] Move page heading and table of contents out of the codec support table. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28949 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/tech/codecs-in.html | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/DOCS/tech/codecs-in.html b/DOCS/tech/codecs-in.html index 060bcec61c..488512d286 100644 --- a/DOCS/tech/codecs-in.html +++ b/DOCS/tech/codecs-in.html @@ -6,19 +6,15 @@ - - - - - - - +

Status of codecs support

+ + + +
-

 

-

Status of codecs support

-
-

Video codecs
Audio codecs

-
Video codecs:

From 366c3fa13d9bf8733f2cadf331f9a0a09c1e4e1f Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 14 Mar 2009 18:44:58 +0000 Subject: [PATCH 88/89] KVA vo driver for OS/2, patch by KO Myung-Hun, komh chollian net git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28950 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Changelog | 1 + DOCS/man/en/mplayer.1 | 17 + Makefile | 1 + configure | 29 ++ libvo/video_out.c | 4 + libvo/vo_kva.c | 1087 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 1139 insertions(+) create mode 100644 libvo/vo_kva.c diff --git a/Changelog b/Changelog index 9ba2a627a1..75d6f927c8 100644 --- a/Changelog +++ b/Changelog @@ -148,6 +148,7 @@ MPlayer (1.0) * removed unnecessary code from vo x11, xv, xvmc * add OS/2 DART audio driver (-ao dart) * add VDPAU video output + * add OS/2 KVA video driver (-vo kva) MEncoder: * check for system-wide configuration file in MEncoder diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 00a3f0c432..502ac04342 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3596,6 +3596,23 @@ Try this option if you have display problems. .PD 1 . .TP +.B kva (OS/2 only) +Video output driver that uses the libkva interface. +.PD 0 +.RSs +.IPs snap +Force SNAP mode. +.IPs wo +Force WarpOverlay! mode. +.IPs dive +Force DIVE mode. +.IPs (no)t23 +Enable/disable workaround for T23 laptop (default: \-not23). +Try to enable this option if your video card supports upscaling only. +.RE +.PD 1 +. +.TP .B quartz (Mac OS X only) Mac OS X Quartz video output driver. Under some circumstances, it might be more efficient to force a diff --git a/Makefile b/Makefile index d14a54d750..c6b2205293 100644 --- a/Makefile +++ b/Makefile @@ -596,6 +596,7 @@ SRCS_MPLAYER-$(IVTV) += libao2/ao_ivtv.c libvo/vo_ivtv.c SRCS_MPLAYER-$(JACK) += libao2/ao_jack.c SRCS_MPLAYER-$(JOYSTICK) += input/joystick.c SRCS_MPLAYER-$(JPEG) += libvo/vo_jpeg.c +SRCS_MPLAYER-$(KVA) += libvo/vo_kva.c SRCS_MPLAYER-$(LIBMENU) += libmenu/menu.c \ libmenu/menu_chapsel.c \ libmenu/menu_cmdlist.c \ diff --git a/configure b/configure index ebf514b129..c3b6fe0925 100755 --- a/configure +++ b/configure @@ -366,6 +366,7 @@ Video output: --enable-vesa enable VESA video output [autodetect] --enable-svga enable SVGAlib video output [autodetect] --enable-sdl enable SDL video output [autodetect] + --enable-kva enable KVA video output [autodetect] --enable-aa enable AAlib video output [autodetect] --enable-caca enable CACA video output [autodetect] --enable-ggi enable GGI video output [autodetect] @@ -556,6 +557,7 @@ _xv=auto _xvmc=no #auto when complete _vdpau=auto _sdl=auto +_kva=auto _direct3d=auto _directx=auto _win32waveout=auto @@ -888,6 +890,8 @@ for ac_option do --disable-vdpau) _vdpau=no ;; --enable-sdl) _sdl=yes ;; --disable-sdl) _sdl=no ;; + --enable-kva) _kva=yes ;; + --disable-kva) _kva=no ;; --enable-direct3d) _direct3d=yes ;; --disable-direct3d) _direct3d=no ;; --enable-directx) _directx=yes ;; @@ -5097,6 +5101,29 @@ fi echores "$_sdl" +if os2 ; then +echocheck "KVA (SNAP/WarpOverlay!/DIVE)" +if test "$_kva" = auto; then + cat > $TMPC << EOF +#include +#include +int main( void ) { return 0; } +EOF + _kva=no; + cc_check -lkva && _kva=yes +fi +if test "$_kva" = yes ; then + def_kva='#define CONFIG_KVA 1' + _libs_mplayer="$_libs_mplayer -lkva" + _vomodules="kva $_vomodules" +else + def_kva='#undef CONFIG_KVA' + _novomodules="kva $_novomodules" +fi +echores "$_kva" +fi #if os2 + + if win32; then echocheck "Windows waveout" @@ -8145,6 +8172,7 @@ IVTV = $_ivtv JACK = $_jack JOYSTICK = $_joystick JPEG = $_jpeg +KVA = $_kva LADSPA = $_ladspa LIBA52 = $_liba52 LIBA52_INTERNAL = $_liba52_internal @@ -8647,6 +8675,7 @@ $def_gl $def_gl_win32 $def_ivtv $def_jpeg +$def_kva $def_md5sum $def_mga $def_mng diff --git a/libvo/video_out.c b/libvo/video_out.c index 05d2291d05..fac5ed90c9 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -112,6 +112,7 @@ extern vo_functions_t video_out_mpegpes; extern vo_functions_t video_out_yuv4mpeg; extern vo_functions_t video_out_direct3d; extern vo_functions_t video_out_directx; +extern vo_functions_t video_out_kva; extern vo_functions_t video_out_dxr2; extern vo_functions_t video_out_dxr3; extern vo_functions_t video_out_ivtv; @@ -146,6 +147,9 @@ const vo_functions_t* const video_out_drivers[] = #ifdef CONFIG_DIRECT3D &video_out_direct3d, #endif +#ifdef CONFIG_KVA + &video_out_kva, +#endif #ifdef CONFIG_COREVIDEO &video_out_macosx, #endif diff --git a/libvo/vo_kva.c b/libvo/vo_kva.c new file mode 100644 index 0000000000..57df14b358 --- /dev/null +++ b/libvo/vo_kva.c @@ -0,0 +1,1087 @@ +/* + * OS/2 video output driver + * + * Copyright (c) 2007-2009 by KO Myung-Hun (komh@chollian.net) + * + * 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. + */ + +#define INCL_WIN +#define INCL_GPI +#define INCL_DOS +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include "config.h" +#include "mp_msg.h" +#include "help_mp.h" +#include "video_out.h" +#include "video_out_internal.h" +#include "aspect.h" + +#include "fastmemcpy.h" +#include "mp_fifo.h" +#include "osdep/keycodes.h" +#include "input/input.h" +#include "input/mouse.h" +#include "subopt-helper.h" +#include "sub.h" + +#include "cpudetect.h" +#include "libswscale/swscale.h" +#include "libmpcodecs/vf_scale.h" + +static const vo_info_t info = { + "SNAP/WarpOverlay!/DIVE video output", + "kva", + "KO Myung-Hun ", + "" +}; + +LIBVO_EXTERN(kva) + +#define WC_MPLAYER "WC_MPLAYER" + +#define SRC_WIDTH m_int.kvas.szlSrcSize.cx +#define SRC_HEIGHT m_int.kvas.szlSrcSize.cy + +#define HWNDFROMWINID(wid) ((wid) + 0x80000000UL) + +static const struct keymap m_vk_map[] = { + {VK_NEWLINE, KEY_ENTER}, {VK_TAB, KEY_TAB}, {VK_SPACE, ' '}, + + // control keys + {VK_CTRL, KEY_CTRL}, {VK_BACKSPACE, KEY_BS}, + {VK_DELETE, KEY_DELETE}, {VK_INSERT, KEY_INSERT}, + {VK_HOME, KEY_HOME}, {VK_END, KEY_END}, + {VK_PAGEUP, KEY_PAGE_UP}, {VK_PAGEDOWN, KEY_PAGE_DOWN}, + {VK_ESC, KEY_ESC}, + + // cursor keys + {VK_RIGHT, KEY_RIGHT}, {VK_LEFT, KEY_LEFT}, + {VK_DOWN, KEY_DOWN}, {VK_UP, KEY_UP}, + + // function keys + {VK_F1, KEY_F+1}, {VK_F2, KEY_F+2}, {VK_F3, KEY_F+3}, {VK_F4, KEY_F+4}, + {VK_F5, KEY_F+5}, {VK_F6, KEY_F+6}, {VK_F7, KEY_F+7}, {VK_F8, KEY_F+8}, + {VK_F9, KEY_F+9}, {VK_F10, KEY_F+10}, {VK_F11, KEY_F+11}, {VK_F12, KEY_F+12}, + + {0, 0} +}; + +static const struct keymap m_keypad_map[] = { + // keypad keys + {0x52, KEY_KP0}, {0x4F, KEY_KP1}, {0x50, KEY_KP2}, {0x51, KEY_KP3}, + {0x4B, KEY_KP4}, {0x4C, KEY_KP5}, {0x4D, KEY_KP6}, {0x47, KEY_KP7}, + {0x48, KEY_KP8}, {0x49, KEY_KP9}, {0x53, KEY_KPDEC}, {0x5A, KEY_KPENTER}, + + {0, 0} +}; + +static const struct keymap m_mouse_map[] = { + {WM_BUTTON1DOWN, MOUSE_BTN0}, + {WM_BUTTON3DOWN, MOUSE_BTN1}, + {WM_BUTTON2DOWN, MOUSE_BTN2}, + {WM_BUTTON1DBLCLK, MOUSE_BTN0_DBL}, + {WM_BUTTON3DBLCLK, MOUSE_BTN1_DBL}, + {WM_BUTTON2DBLCLK, MOUSE_BTN2_DBL}, + + {0, 0} +}; + +struct { + HAB hab; + HMQ hmq; + HWND hwndFrame; + HWND hwndClient; + HWND hwndSysMenu; + HWND hwndTitleBar; + HWND hwndMinMax; + FOURCC fcc; + int iImageFormat; + int nChromaShift; + KVASETUP kvas; + KVACAPS kvac; + RECTL rclDst; + int bpp; + LONG lStride; + PBYTE pbImage; + BOOL fFixT23; + PFNWP pfnwpOldFrame; + uint8_t *planes[3]; // y = 0, u = 1, v = 2 + int stride[3]; + BOOL fHWAccel; + RECTL rclParent; + struct SwsContext *sws; +} m_int; + +static inline void setAspectRatio(ULONG ulRatio) +{ + m_int.kvas.ulRatio = ulRatio; + kvaSetup(&m_int.kvas); +} + +static int query_format_info(int format, PBOOL pfHWAccel, PFOURCC pfcc, + int *pbpp, int *pnChromaShift) +{ + BOOL fHWAccel; + FOURCC fcc; + INT bpp; + INT nChromaShift; + + switch (format) { + case IMGFMT_YV12: + fHWAccel = m_int.kvac.ulInputFormatFlags & KVAF_YV12; + fcc = FOURCC_YV12; + bpp = 1; + nChromaShift = 1; + break; + + case IMGFMT_YUY2: + fHWAccel = m_int.kvac.ulInputFormatFlags & KVAF_YUY2; + fcc = FOURCC_Y422; + bpp = 2; + nChromaShift = 0; + break; + + case IMGFMT_YVU9: + fHWAccel = m_int.kvac.ulInputFormatFlags & KVAF_YVU9; + fcc = FOURCC_YVU9; + bpp = 1; + nChromaShift = 2; + break; + + case IMGFMT_BGR24: + fHWAccel = m_int.kvac.ulInputFormatFlags & KVAF_BGR24; + fcc = FOURCC_BGR3; + bpp = 3; + nChromaShift = 0; + break; + + case IMGFMT_BGR16: + fHWAccel = m_int.kvac.ulInputFormatFlags & KVAF_BGR16; + fcc = FOURCC_R565; + bpp = 2; + nChromaShift = 0; + break; + + case IMGFMT_BGR15: + fHWAccel = m_int.kvac.ulInputFormatFlags & KVAF_BGR15; + fcc = FOURCC_R555; + bpp = 2; + nChromaShift = 0; + break; + + default: + return 1; + } + + if (pfHWAccel) + *pfHWAccel = fHWAccel; + + if (pfcc) + *pfcc = fcc; + + if (pbpp) + *pbpp = bpp; + + if (pnChromaShift) + *pnChromaShift = nChromaShift; + + return 0; +} + +static void imgCreate(void) +{ + int size = SRC_HEIGHT * m_int.lStride;; + + switch (m_int.iImageFormat) { + case IMGFMT_YV12: + size += size / 2; + break; + + case IMGFMT_YVU9: + size += size / 8; + break; + } + + m_int.pbImage = malloc(size); + + m_int.planes[0] = m_int.pbImage; + m_int.stride[0] = m_int.lStride; + + // YV12 or YVU9 ? + if (m_int.nChromaShift) { + m_int.planes[1] = m_int.planes[0] + SRC_HEIGHT * m_int.stride[0]; + m_int.stride[1] = m_int.stride[0] >> m_int.nChromaShift; + + m_int.planes[2] = m_int.planes[1] + + (SRC_HEIGHT >> m_int.nChromaShift) * m_int.stride[1]; + m_int.stride[2] = m_int.stride[1]; + } +} + +static void imgFree(void) +{ + free(m_int.pbImage); + + m_int.pbImage = NULL; +} + +static void imgDisplay(void) +{ + PVOID pBuffer; + ULONG ulBPL; + + if (!kvaLockBuffer(&pBuffer, &ulBPL)) { + uint8_t *dst[3]; + int dstStride[3]; + + // Get packed or Y + dst[0] = pBuffer; + dstStride[0] = ulBPL; + + // YV12 or YVU9 ? + if (m_int.nChromaShift) { + // Get V + dst[2] = dst[0] + SRC_HEIGHT * dstStride[0]; + dstStride[2] = dstStride[0] >> m_int.nChromaShift; + + // Get U + dst[1] = dst[2] + + (SRC_HEIGHT >> m_int.nChromaShift ) * dstStride[2]; + dstStride[1] = dstStride[2]; + } + + if (m_int.fHWAccel) { + int w, h; + + w = m_int.stride[0]; + h = SRC_HEIGHT; + + // Copy packed or Y + mem2agpcpy_pic(dst[0], m_int.planes[0], w, h, + dstStride[0], m_int.stride[0]); + + // YV12 or YVU9 ? + if (m_int.nChromaShift) { + w >>= m_int.nChromaShift; h >>= m_int.nChromaShift; + + // Copy U + mem2agpcpy_pic(dst[1], m_int.planes[1], w, h, + dstStride[1], m_int.stride[1]); + + // Copy V + mem2agpcpy_pic(dst[2], m_int.planes[2], w, h, + dstStride[2], m_int.stride[2]); + } + } else { + sws_scale(m_int.sws, m_int.planes, m_int.stride, 0, SRC_HEIGHT, + dst, dstStride); + } + + kvaUnlockBuffer(); + } +} + +// Frame window procedure to work around T23 laptop with S3 video card, +// which supports upscaling only. +static MRESULT EXPENTRY NewFrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, + MPARAM mp2) +{ + switch (msg) { + case WM_QUERYTRACKINFO: + { + PTRACKINFO pti = (PTRACKINFO)mp2; + RECTL rcl; + + if (vo_fs) + break; + + m_int.pfnwpOldFrame(hwnd, msg, mp1, mp2); + + rcl.xLeft = 0; + rcl.yBottom = 0; + rcl.xRight = SRC_WIDTH + 1; + rcl.yTop = SRC_HEIGHT + 1; + + WinCalcFrameRect(hwnd, &rcl, FALSE); + + pti->ptlMinTrackSize.x = rcl.xRight - rcl.xLeft; + pti->ptlMinTrackSize.y = rcl.yTop - rcl.yBottom; + + pti->ptlMaxTrackSize.x = vo_screenwidth; + pti->ptlMaxTrackSize.y = vo_screenheight; + + return (MRESULT)TRUE; + } + + case WM_ADJUSTWINDOWPOS: + { + PSWP pswp = (PSWP)mp1; + RECTL rcl; + + if (vo_fs) + break; + + if (pswp->fl & SWP_SIZE) { + rcl.xLeft = pswp->x; + rcl.yBottom = pswp->y; + rcl.xRight = rcl.xLeft + pswp->cx; + rcl.yTop = rcl.yBottom + pswp->cy; + + WinCalcFrameRect(hwnd, &rcl, TRUE); + + if (rcl.xRight - rcl.xLeft <= SRC_WIDTH) + rcl.xRight = rcl.xLeft + (SRC_WIDTH + 1); + + if (rcl.yTop - rcl.yBottom <= SRC_HEIGHT) + rcl.yTop = rcl.yBottom + (SRC_HEIGHT + 1); + + WinCalcFrameRect(hwnd, &rcl, FALSE); + + if (rcl.xRight - rcl.xLeft > vo_screenwidth) { + rcl.xLeft = 0; + rcl.xRight = vo_screenwidth; + } + + if (rcl.yTop - rcl.yBottom > vo_screenheight) { + rcl.yBottom = 0; + rcl.yTop = vo_screenheight; + } + + pswp->fl |= SWP_MOVE; + pswp->x = rcl.xLeft; + pswp->y = rcl.yBottom; + pswp->cx = rcl.xRight - rcl.xLeft; + pswp->cy = rcl.yTop - rcl.yBottom; + } + break; + } + } + + return m_int.pfnwpOldFrame(hwnd, msg, mp1, mp2); +} + +static MRESULT EXPENTRY WndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) +{ + // if slave mode, ignore mouse events and deliver them to a parent window + if (WinID != -1 && + ((msg >= WM_MOUSEFIRST && msg <= WM_MOUSELAST) || + (msg >= WM_EXTMOUSEFIRST && msg <= WM_EXTMOUSELAST))) { + WinPostMsg(HWNDFROMWINID(WinID), msg, mp1, mp2); + + return (MRESULT)TRUE; + } + + switch (msg) { + case WM_CLOSE: + mplayer_put_key(KEY_CLOSE_WIN); + + return 0; + + case WM_CHAR: + { + USHORT fsFlags = SHORT1FROMMP(mp1); + UCHAR uchScan = CHAR4FROMMP(mp1); + USHORT usCh = SHORT1FROMMP(mp2); + USHORT usVk = SHORT2FROMMP(mp2); + int mpkey; + + if (fsFlags & KC_KEYUP) + break; + + if (fsFlags & KC_SCANCODE) { + mpkey = lookup_keymap_table(m_keypad_map, uchScan); + if (mpkey) { + // distinguish KEY_KP0 and KEY_KPINS + if (mpkey == KEY_KP0 && usCh != '0') + mpkey = KEY_KPINS; + + // distinguish KEY_KPDEC and KEY_KPDEL + if (mpkey == KEY_KPDEC && usCh != '.') + mpkey = KEY_KPDEL; + + mplayer_put_key(mpkey); + + return (MRESULT)TRUE; + } + } + + if (fsFlags & KC_VIRTUALKEY) { + mpkey = lookup_keymap_table(m_vk_map, usVk); + if (mpkey) { + mplayer_put_key(mpkey); + + return (MRESULT)TRUE; + } + } + + if ((fsFlags & KC_CHAR) && !HIBYTE(usCh)) + mplayer_put_key(usCh); + + return (MRESULT)TRUE; + } + + case WM_BUTTON1DOWN: + case WM_BUTTON3DOWN: + case WM_BUTTON2DOWN: + case WM_BUTTON1DBLCLK: + case WM_BUTTON3DBLCLK: + case WM_BUTTON2DBLCLK: + if (WinQueryFocus(HWND_DESKTOP) != hwnd) + WinSetFocus(HWND_DESKTOP, hwnd); + else if (!vo_nomouse_input) + mplayer_put_key(lookup_keymap_table(m_mouse_map, msg)); + + return (MRESULT)TRUE; + + case WM_PAINT: + { + HPS hps; + RECTL rcl, rclDst; + PRECTL prcl = NULL; + HRGN hrgn, hrgnDst; + RGNRECT rgnCtl; + + // get a current movie area + kvaAdjustDstRect(&m_int.kvas.rclSrcRect, &rclDst); + + // get a current invalidated area + hps = WinBeginPaint(hwnd, NULLHANDLE, &rcl); + + // create a region for an invalidated area + hrgn = GpiCreateRegion(hps, 1, &rcl); + // create a region for a movie area + hrgnDst = GpiCreateRegion(hps, 1, &rclDst); + + // exclude a movie area from an invalidated area + GpiCombineRegion(hps, hrgn, hrgn, hrgnDst, CRGN_DIFF); + + // get rectangles from the region + rgnCtl.ircStart = 1; + rgnCtl.ulDirection = RECTDIR_LFRT_TOPBOT; + GpiQueryRegionRects(hps, hrgn, NULL, &rgnCtl, NULL); + + if (rgnCtl.crcReturned > 0) { + rgnCtl.crc = rgnCtl.crcReturned; + prcl = malloc(sizeof(RECTL) * rgnCtl.crcReturned); + } + + // draw black bar if needed + if (prcl && GpiQueryRegionRects(hps, hrgn, NULL, &rgnCtl, prcl)) { + int i; + + for (i = 0; i < rgnCtl.crcReturned; i++) + WinFillRect(hps, &prcl[i], CLR_BLACK); + } + + free(prcl); + + GpiDestroyRegion(hps, hrgnDst); + GpiDestroyRegion(hps, hrgn); + + WinEndPaint(hps); + + return 0; + } + } + + return WinDefWindowProc(hwnd, msg, mp1, mp2); +} + +// Change process type from VIO to PM to use PM APIs. +static void morphToPM(void) +{ + PPIB pib; + + DosGetInfoBlocks(NULL, &pib); + + // Change flag from VIO to PM: + if (pib->pib_ultype == 2) + pib->pib_ultype = 3; +} + +static int preinit(const char *arg) +{ + HWND hwndParent; + ULONG flFrameFlags; + ULONG kvaMode = 0; + + int fUseSnap = 0; + int fUseWO = 0; + int fUseDive = 0; + int fFixT23 = 0; + + const opt_t subopts[] = { + {"snap", OPT_ARG_BOOL, &fUseSnap, NULL}, + {"wo", OPT_ARG_BOOL, &fUseWO, NULL}, + {"dive", OPT_ARG_BOOL, &fUseDive, NULL}, + {"t23", OPT_ARG_BOOL, &fFixT23, NULL}, + {NULL, 0, NULL, NULL} + }; + + PCSZ pcszVideoModeStr[3] = {"DIVE", "WarpOverlay!", "SNAP"}; + + if (subopt_parse(arg, subopts) != 0) + return -1; + + morphToPM(); + + memset(&m_int, 0, sizeof(m_int)); + + m_int.hab = WinInitialize(0); + m_int.hmq = WinCreateMsgQueue(m_int.hab, 0); + + WinRegisterClass(m_int.hab, + WC_MPLAYER, + WndProc, + CS_SIZEREDRAW | CS_MOVENOTIFY, + sizeof(PVOID)); + + if (WinID == -1) { + hwndParent = HWND_DESKTOP; + flFrameFlags = FCF_SYSMENU | FCF_TITLEBAR | FCF_MINMAX | + FCF_SIZEBORDER | FCF_TASKLIST; + } else { + hwndParent = HWNDFROMWINID(WinID); + flFrameFlags = 0; + } + + m_int.hwndFrame = + WinCreateStdWindow(hwndParent, // parent window handle + WS_VISIBLE, // frame window style + &flFrameFlags, // window style + WC_MPLAYER, // class name + "", // window title + 0L, // default client style + NULLHANDLE, // resource in exe file + 1, // frame window id + &m_int.hwndClient); // client window handle + + if (m_int.hwndFrame == NULLHANDLE) + return -1; + + m_int.hwndSysMenu = WinWindowFromID(m_int.hwndFrame, FID_SYSMENU); + m_int.hwndTitleBar = WinWindowFromID(m_int.hwndFrame, FID_TITLEBAR); + m_int.hwndMinMax = WinWindowFromID(m_int.hwndFrame, FID_MINMAX); + + m_int.fFixT23 = fFixT23; + + if (m_int.fFixT23) + m_int.pfnwpOldFrame = WinSubclassWindow(m_int.hwndFrame, + NewFrameWndProc); + + if (!!fUseSnap + !!fUseWO + !!fUseDive > 1) + mp_msg(MSGT_VO, MSGL_WARN,"KVA: Multiple mode specified!!!\n"); + + if (fUseSnap) + kvaMode = KVAM_SNAP; + else if (fUseWO) + kvaMode = KVAM_WO; + else if (fUseDive) + kvaMode = KVAM_DIVE; + else + kvaMode = KVAM_AUTO; + + if (kvaInit(kvaMode, m_int.hwndClient, vo_colorkey)) { + mp_msg(MSGT_VO, MSGL_ERR, "KVA: Init failed!!!\n"); + + return -1; + } + + kvaCaps(&m_int.kvac); + + mp_msg(MSGT_VO, MSGL_V, "KVA: Selected video mode = %s\n", + pcszVideoModeStr[m_int.kvac.ulMode - 1]); + + kvaDisableScreenSaver(); + + // Might cause PM DLLs to be loaded which incorrectly enable SIG_FPE, + // so mask off all floating-point exceptions. + _control87(MCW_EM, MCW_EM); + + return 0; +} + +static void uninit(void) +{ + kvaEnableScreenSaver(); + + imgFree(); + + sws_freeContext(m_int.sws); + + if (m_int.hwndFrame != NULLHANDLE) { + kvaResetAttr(); + kvaDone(); + + if (m_int.fFixT23) + WinSubclassWindow(m_int.hwndFrame, m_int.pfnwpOldFrame); + + WinDestroyWindow(m_int.hwndFrame); + } + + WinDestroyMsgQueue(m_int.hmq); + WinTerminate(m_int.hab); +} + +static int config(uint32_t width, uint32_t height, + uint32_t d_width, uint32_t d_height, + uint32_t flags, char *title, uint32_t format) +{ + RECTL rcl; + + mp_msg(MSGT_VO, MSGL_V, + "KVA: Using 0x%X (%s) image format, vo_config_count = %d\n", + format, vo_format_name(format), vo_config_count); + + imgFree(); + + if (query_format_info(format, &m_int.fHWAccel, &m_int.fcc, &m_int.bpp, + &m_int.nChromaShift)) + return 1; + + m_int.iImageFormat = format; + + // if there is no hw accel for given format, + // try any format supported by hw accel + if (!m_int.fHWAccel) { + int dstFormat = 0; + + sws_freeContext(m_int.sws); + + if (m_int.kvac.ulInputFormatFlags & KVAF_YV12) + dstFormat = IMGFMT_YV12; + else if (m_int.kvac.ulInputFormatFlags & KVAF_YUY2) + dstFormat = IMGFMT_YUY2; + else if (m_int.kvac.ulInputFormatFlags & KVAF_YVU9) + dstFormat = IMGFMT_YVU9; + else if (m_int.kvac.ulInputFormatFlags & KVAF_BGR24) + dstFormat = IMGFMT_BGR24; + else if (m_int.kvac.ulInputFormatFlags & KVAF_BGR16) + dstFormat = IMGFMT_BGR16; + else if (m_int.kvac.ulInputFormatFlags & KVAF_BGR15) + dstFormat = IMGFMT_BGR15; + + if (query_format_info(dstFormat, NULL, &m_int.fcc, NULL, NULL)) + return 1; + + m_int.sws = sws_getContextFromCmdLine(width, height, format, + width, height, dstFormat); + } + + mp_msg(MSGT_VO, MSGL_V, "KVA: Selected FOURCC = %.4s\n", (char *)&m_int.fcc); + + m_int.kvas.ulLength = sizeof(KVASETUP); + m_int.kvas.szlSrcSize.cx = width; + m_int.kvas.szlSrcSize.cy = height; + m_int.kvas.rclSrcRect.xLeft = 0; + m_int.kvas.rclSrcRect.yTop = 0; + m_int.kvas.rclSrcRect.xRight = width; + m_int.kvas.rclSrcRect.yBottom = height; + m_int.kvas.ulRatio = vo_keepaspect ? KVAR_FORCEANY : KVAR_NONE; + m_int.kvas.ulAspectWidth = d_width; + m_int.kvas.ulAspectHeight = d_height; + m_int.kvas.fccSrcColor = m_int.fcc; + m_int.kvas.fDither = TRUE; + + if (kvaSetup(&m_int.kvas)) { + mp_msg(MSGT_VO, MSGL_ERR, "KVA: Setup failed!!!\n"); + + return 1; + } + + m_int.lStride = width * m_int.bpp; + + imgCreate(); + + if (WinID == -1) { + WinSetWindowText(m_int.hwndFrame, title); + + // initialize 'vo_fs' only once at first config() call + if (vo_config_count == 0) + vo_fs = flags & VOFLAG_FULLSCREEN; + + // workaround for T23 laptop with S3 Video by Franz Bakan + if (!vo_fs && m_int.fFixT23) { + d_width++; + d_height++; + } + + m_int.rclDst.xLeft = ((LONG)vo_screenwidth - (LONG)d_width) / 2; + m_int.rclDst.yBottom = ((LONG)vo_screenheight - (LONG)d_height) / 2; + m_int.rclDst.xRight = m_int.rclDst.xLeft + d_width; + m_int.rclDst.yTop = m_int.rclDst.yBottom + d_height; + + if (vo_fs) { + d_width = vo_screenwidth; + d_height = vo_screenheight; + + // when -fs option is used without this, title bar is not highlighted + WinSetActiveWindow(HWND_DESKTOP, m_int.hwndFrame); + + WinSetParent(m_int.hwndSysMenu, HWND_OBJECT, FALSE); + WinSetParent(m_int.hwndTitleBar, HWND_OBJECT, FALSE); + WinSetParent(m_int.hwndMinMax, HWND_OBJECT, FALSE); + + setAspectRatio(KVAR_FORCEANY); + } + + rcl.xLeft = ((LONG)vo_screenwidth - (LONG)d_width) / 2; + rcl.yBottom = ((LONG)vo_screenheight - (LONG)d_height) /2 ; + rcl.xRight = rcl.xLeft + d_width; + rcl.yTop = rcl.yBottom + d_height; + } else { + vo_fs = 0; + + WinQueryWindowRect(HWNDFROMWINID(WinID), &m_int.rclDst); + rcl = m_int.rclDst; + } + + WinCalcFrameRect(m_int.hwndFrame, &rcl, FALSE); + + WinSetWindowPos(m_int.hwndFrame, HWND_TOP, + rcl.xLeft, rcl.yBottom, + rcl.xRight - rcl.xLeft, rcl.yTop - rcl.yBottom, + SWP_SIZE | SWP_MOVE | SWP_ZORDER | SWP_SHOW | + (WinID == -1 ? SWP_ACTIVATE : 0)); + + WinInvalidateRect(m_int.hwndFrame, NULL, TRUE); + + return 0; +} + +static uint32_t get_image(mp_image_t *mpi) +{ + if (m_int.iImageFormat != mpi->imgfmt) + return VO_FALSE; + + if (mpi->type == MP_IMGTYPE_STATIC || mpi->type == MP_IMGTYPE_TEMP) { + if (mpi->flags & MP_IMGFLAG_PLANAR) { + mpi->planes[1] = m_int.planes[1]; + mpi->planes[2] = m_int.planes[2]; + + mpi->stride[1] = m_int.stride[1]; + mpi->stride[2] = m_int.stride[2]; + } + + mpi->planes[0] = m_int.planes[0]; + mpi->stride[0] = m_int.stride[0]; + mpi->flags |= MP_IMGFLAG_DIRECT; + + return VO_TRUE; + } + + return VO_FALSE; +} + +static uint32_t draw_image(mp_image_t *mpi) +{ + // if -dr or -slices then do nothing: + if (mpi->flags & (MP_IMGFLAG_DIRECT | MP_IMGFLAG_DRAW_CALLBACK)) + return VO_TRUE; + + draw_slice(mpi->planes, mpi->stride, mpi->w, mpi->h, mpi->x, mpi->y); + + return VO_TRUE; +} + +static int query_format(uint32_t format) +{ + BOOL fHWAccel; + int res; + + if (query_format_info(format, &fHWAccel, NULL, NULL, NULL)) + return 0; + + res = VFCAP_CSP_SUPPORTED | VFCAP_OSD; + if (fHWAccel) { + res |= VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_HWSCALE_UP; + + if (!m_int.fFixT23) + res |= VFCAP_HWSCALE_DOWN; + } + + return res; +} + +static int fs_toggle(void) +{ + RECTL rcl; + + vo_fs = !vo_fs; + + if (vo_fs) { + SWP swp; + + WinQueryWindowPos(m_int.hwndFrame, &swp); + m_int.rclDst.xLeft = swp.x; + m_int.rclDst.yBottom = swp.y; + m_int.rclDst.xRight = m_int.rclDst.xLeft + swp.cx; + m_int.rclDst.yTop = m_int.rclDst.yBottom + swp.cy; + WinCalcFrameRect(m_int.hwndFrame, &m_int.rclDst, TRUE); + + if (WinID != -1) + WinSetParent(m_int.hwndFrame, HWND_DESKTOP, FALSE); + + WinSetParent(m_int.hwndSysMenu, HWND_OBJECT, FALSE); + WinSetParent(m_int.hwndTitleBar, HWND_OBJECT, FALSE); + WinSetParent(m_int.hwndMinMax, HWND_OBJECT, FALSE); + + rcl.xLeft = 0; + rcl.yBottom = 0; + rcl.xRight = vo_screenwidth; + rcl.yTop = vo_screenheight; + + setAspectRatio(KVAR_FORCEANY); + } else { + if (WinID != -1) + WinSetParent(m_int.hwndFrame, HWNDFROMWINID(WinID), TRUE); + + WinSetParent(m_int.hwndSysMenu, m_int.hwndFrame, FALSE); + WinSetParent(m_int.hwndTitleBar, m_int.hwndFrame, FALSE); + WinSetParent(m_int.hwndMinMax, m_int.hwndFrame, FALSE); + + rcl = m_int.rclDst; + + setAspectRatio(vo_keepaspect ? KVAR_FORCEANY : KVAR_NONE); + } + + WinCalcFrameRect(m_int.hwndFrame, &rcl, FALSE); + + WinSetWindowPos(m_int.hwndFrame, HWND_TOP, + rcl.xLeft, rcl.yBottom, + rcl.xRight - rcl.xLeft, rcl.yTop - rcl.yBottom, + SWP_SIZE | SWP_MOVE | SWP_ZORDER | SWP_SHOW | + (WinID == -1 ? SWP_ACTIVATE : 0)); + + return VO_TRUE; +} + +static int color_ctrl_set(char *what, int value) +{ + ULONG ulAttr; + ULONG ulValue; + + if (!strcmp(what, "brightness")) + ulAttr = KVAA_BRIGHTNESS; + else if (!strcmp(what, "contrast")) + ulAttr = KVAA_CONTRAST; + else if (!strcmp(what, "hue")) + ulAttr = KVAA_HUE; + else if (!strcmp(what, "saturation")) + ulAttr = KVAA_SATURATION; + else + return VO_NOTIMPL; + + ulValue = (value + 100) * 255 / 200; + + if (kvaSetAttr(ulAttr, &ulValue)) + return VO_NOTIMPL; + + return VO_TRUE; +} + +static int color_ctrl_get(char *what, int *value) +{ + ULONG ulAttr; + ULONG ulValue; + + if (!strcmp(what, "brightness")) + ulAttr = KVAA_BRIGHTNESS; + else if (!strcmp(what, "contrast")) + ulAttr = KVAA_CONTRAST; + else if (!strcmp(what, "hue")) + ulAttr = KVAA_HUE; + else if (!strcmp(what, "saturation")) + ulAttr = KVAA_SATURATION; + else + return VO_NOTIMPL; + + if (kvaQueryAttr(ulAttr, &ulValue)) + return VO_NOTIMPL; + + // add 1 to adjust range + *value = ((ulValue + 1) * 200 / 255) - 100; + + return VO_TRUE; +} + +static int control(uint32_t request, void *data, ...) +{ + switch (request) { + case VOCTRL_GET_IMAGE: + return get_image(data); + + case VOCTRL_DRAW_IMAGE: + return draw_image(data); + + case VOCTRL_QUERY_FORMAT: + return query_format(*(uint32_t *)data); + + case VOCTRL_FULLSCREEN: + return fs_toggle(); + + case VOCTRL_SET_EQUALIZER: + { + va_list ap; + int value; + + va_start(ap, data); + value = va_arg(ap, int); + va_end(ap); + + return color_ctrl_set(data, value); + } + + case VOCTRL_GET_EQUALIZER: + { + va_list ap; + int *value; + + va_start(ap, data); + value = va_arg(ap, int *); + va_end(ap); + + return color_ctrl_get(data, value); + } + + case VOCTRL_UPDATE_SCREENINFO: + vo_screenwidth = m_int.kvac.cxScreen; + vo_screenheight = m_int.kvac.cyScreen; + + aspect_save_screenres(vo_screenwidth, vo_screenheight); + + return VO_TRUE; + } + + return VO_NOTIMPL; +} + +static int draw_frame(uint8_t *src[]) +{ + return VO_ERROR; +} + +static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y) +{ + uint8_t *s; + uint8_t *d; + + // copy packed or Y + d = m_int.planes[0] + m_int.stride[0] * y + x; + s = src[0]; + mem2agpcpy_pic(d, s, w * m_int.bpp, h, m_int.stride[0], stride[0]); + + // YV12 or YVU9 + if (m_int.nChromaShift) { + w >>= m_int.nChromaShift; h >>= m_int.nChromaShift; + x >>= m_int.nChromaShift; y >>= m_int.nChromaShift; + + // copy U + d = m_int.planes[1] + m_int.stride[1] * y + x; + s = src[1]; + mem2agpcpy_pic(d, s, w, h, m_int.stride[1], stride[1]); + + // copy V + d = m_int.planes[2] + m_int.stride[2] * y + x; + s = src[2]; + mem2agpcpy_pic(d, s, w, h, m_int.stride[2], stride[2]); + } + + return 0; +} + +#define vo_draw_alpha(imgfmt) \ + vo_draw_alpha_##imgfmt(w, h, src, srca, stride, \ + m_int.planes[0] + m_int.stride[0] * y0 + m_int.bpp * x0, \ + m_int.stride[0]) + +static void draw_alpha(int x0, int y0, int w, int h, + unsigned char *src, unsigned char *srca, int stride) +{ + switch (m_int.iImageFormat) { + case IMGFMT_YV12: + case IMGFMT_YVU9: + vo_draw_alpha(yv12); + break; + + case IMGFMT_YUY2: + vo_draw_alpha(yuy2); + break; + + case IMGFMT_BGR24: + vo_draw_alpha(rgb24); + break; + + case IMGFMT_BGR16: + vo_draw_alpha(rgb16); + break; + + case IMGFMT_BGR15: + vo_draw_alpha(rgb15); + break; + } +} + +static void draw_osd(void) +{ + vo_draw_text(SRC_WIDTH, SRC_HEIGHT, draw_alpha); +} + +static void flip_page(void) +{ + imgDisplay(); +} + +static void check_events(void) +{ + QMSG qm; + + // On slave mode, we need to change our window size according to a + // parent window size + if (WinID != -1) { + RECTL rcl; + + WinQueryWindowRect(HWNDFROMWINID(WinID), &rcl); + + if (rcl.xLeft != m_int.rclParent.xLeft || + rcl.yBottom != m_int.rclParent.yBottom || + rcl.xRight != m_int.rclParent.xRight || + rcl.yTop != m_int.rclParent.yTop) { + WinSetWindowPos(m_int.hwndFrame, NULLHANDLE, + rcl.xLeft, rcl.yBottom, + rcl.xRight - rcl.xLeft, rcl.yTop - rcl.yBottom, + SWP_SIZE | SWP_MOVE); + + m_int.rclParent = rcl; + } + } + + while (WinPeekMsg(m_int.hab, &qm, NULLHANDLE, 0, 0, PM_REMOVE)) + WinDispatchMsg(m_int.hab, &qm); +} From 642162c07460e439d1d81cda4643dc028ed238e0 Mon Sep 17 00:00:00 2001 From: gpoirier Date: Sat, 14 Mar 2009 20:58:18 +0000 Subject: [PATCH 89/89] sync w/r28950 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28951 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/fr/mplayer.1 | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1 index 495581b57d..5d32ecf8be 100644 --- a/DOCS/man/fr/mplayer.1 +++ b/DOCS/man/fr/mplayer.1 @@ -1,4 +1,4 @@ -.\" synced with r28895 +.\" synced with r28950 .\" Encoding: iso-8859-1 .\" MPlayer (C) 2000-2009 MPlayer Team .\" The English man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann @@ -3647,6 +3647,9 @@ r .IPs deint=<0\-4> Sélectionne un désentrelaceur (par défaut\ : 0) Tous les modes > 0 respectent \-field\-dominance. +.br +.I NOTE\ : +Les valeurs > 2 retardent la sortie vidéo d'une image. .RSss .IPs 0 pas de désentrelacement @@ -3775,6 +3778,24 @@ Essayez cette option si vous avez des probl .PD 1 . .TP +.B kva (OS/2 uniquement) +Pilote de sortie vidéo utilisant l'interface libkva. +.PD 0 +.RSs +.IPs snap +Force le mode SNAP. +.IPs wo +Force le mode WarpOverlay!. +.IPs dive +Force le mode DIVE. +.IPs (no)t23 +Active le contournement pour les bugs de l'ordinateur portable T23. +Essayez d'activer cette option si votre carte vidéo ne gère que +l'agrandissement d'image (upscaling). +.RE +.PD 1 +. +.TP .B quartz (Mac OS X uniquement) Pilote de sortie vidéo Quartz pour Mac OS X. Dans certains cas, il est préférable de forcer le format de sortie packed YUV,