Update of /cvsroot/mplayer/main/libmpcodecs In directory mail:/var/tmp.root/cvs-serv21617 Modified Files: vf_scale.c Log Message: another lame workaround for the g1 filter layer ... now filter chains with >8 scale filters initalize before u fall asleep Index: vf_scale.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_scale.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- vf_scale.c 9 Oct 2003 22:32:30 -0000 1.47 +++ vf_scale.c 3 Nov 2003 12:15:32 -0000 1.48 @@ -25,6 +25,7 @@ unsigned int fmt; struct SwsContext *ctx; unsigned char* palette; + int query_format_cache[64]; } vf_priv_dflt = { -1,-1, 0, @@ -77,14 +78,24 @@ static unsigned int find_best_out(vf_instance_t *vf){ unsigned int best=0; - unsigned int* p=outfmt_list; + int i; + // find the best outfmt: - while(*p){ - int ret=vf_next_query_format(vf,*p); - mp_msg(MSGT_VFILTER,MSGL_DBG2,"scale: query(%s) -> %d\n",vo_format_name(*p),ret&3); - if(ret&VFCAP_CSP_SUPPORTED_BY_HW){ best=*p; break;} // no conversion -> bingo! - if(ret&VFCAP_CSP_SUPPORTED && !best) best=*p; // best with conversion - ++p; + for(i=0; i<sizeof(outfmt_list)/sizeof(int)-1; i++){ + const int format= outfmt_list[i]; + int ret= vf->priv->query_format_cache[i]-1; + if(ret == -1){ + ret= vf_next_query_format(vf, outfmt_list[i]); + vf->priv->query_format_cache[i]= ret+1; + } + + mp_msg(MSGT_VFILTER,MSGL_DBG2,"scale: query(%s) -> %d\n",vo_format_name(format),ret&3); + if(ret&VFCAP_CSP_SUPPORTED_BY_HW){ + best=format; // no conversion -> bingo! + break; + } + if(ret&VFCAP_CSP_SUPPORTED && !best) + best=format; // best with conversion } return best; } @@ -437,7 +448,7 @@ src_filter= sws_getDefaultFilter( sws_lum_gblur, sws_chr_gblur, sws_lum_sharpen, sws_chr_sharpen, - sws_chr_vshift, sws_chr_hshift, verbose>1); + sws_chr_hshift, sws_chr_vshift, verbose>1); switch(sws_flags) {
Hi On Monday 03 November 2003 13:15, Michael Niedermayer CVS wrote:
Update of /cvsroot/mplayer/main/libmpcodecs In directory mail:/var/tmp.root/cvs-serv21617
Modified Files: vf_scale.c Log Message: another lame workaround for the g1 filter layer ... now filter chains with >8 scale filters initalize before u fall asleep
Index: vf_scale.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_scale.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- vf_scale.c 9 Oct 2003 22:32:30 -0000 1.47 +++ vf_scale.c 3 Nov 2003 12:15:32 -0000 1.48 @@ -25,6 +25,7 @@ unsigned int fmt; struct SwsContext *ctx; unsigned char* palette; + int query_format_cache[64]; maybe that should be moved to vf_instance_t and the cacheing code to vf_next_query_format() ?
... and IMHO query_format() should output more info then the flags (something like a quality(sum of sqared errors) & speed(cpu cycles) but thats for g2 probably, and no, its not complicated, filters just pass the info from the next and add some constants which may be always 0 if they are unknown, that would also ensure that no nonsense filterchains like the RGB->YUV->RGB->... stuff is generated [...] -- Michael level[i]= get_vlc(); i+=get_vlc(); (violates patent EP0266049) median(mv[y-1][x], mv[y][x-1], mv[y+1][x+1]); (violates patent #5,905,535) buf[i]= qp - buf[i-1]; (violates patent #?) for more examples, see http://mplayerhq.hu/~michael/patent.html stop it, see http://petition.eurolinux.org & http://petition.ffii.org/eubsa/en
Hi,
Update of /cvsroot/mplayer/main/libmpcodecs In directory mail:/var/tmp.root/cvs-serv21617
Modified Files: vf_scale.c Log Message: another lame workaround for the g1 filter layer ... now filter chains with >8 scale filters initalize before u fall asleep
lol :)
@@ -437,7 +448,7 @@ src_filter= sws_getDefaultFilter( sws_lum_gblur, sws_chr_gblur, sws_lum_sharpen, sws_chr_sharpen, - sws_chr_vshift, sws_chr_hshift, verbose>1); + sws_chr_hshift, sws_chr_vshift, verbose>1);
switch(sws_flags)
and the hidden bugfix :) do you really believe you can escape from the 100l punishment? :))) A'rpi / Astral & ESP-team -- Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu
Hi On Monday 03 November 2003 14:50, Arpi wrote: [...]
@@ -437,7 +448,7 @@ src_filter= sws_getDefaultFilter( sws_lum_gblur, sws_chr_gblur, sws_lum_sharpen, sws_chr_sharpen, - sws_chr_vshift, sws_chr_hshift, verbose>1); + sws_chr_hshift, sws_chr_vshift, verbose>1);
switch(sws_flags)
and the hidden bugfix :) sadly only half fix, iam still searching the other half ...
do you really believe you can escape from the 100l punishment? :))) damn, i should have added more cosmetics :)
[...] -- Michael level[i]= get_vlc(); i+=get_vlc(); (violates patent EP0266049) median(mv[y-1][x], mv[y][x-1], mv[y+1][x+1]); (violates patent #5,905,535) buf[i]= qp - buf[i-1]; (violates patent #?) for more examples, see http://mplayerhq.hu/~michael/patent.html stop it, see http://petition.eurolinux.org & http://petition.ffii.org/eubsa/en
Hi
On Monday 03 November 2003 14:50, Arpi wrote: [...]
@@ -437,7 +448,7 @@ src_filter= sws_getDefaultFilter( sws_lum_gblur, sws_chr_gblur, sws_lum_sharpen, sws_chr_sharpen, - sws_chr_vshift, sws_chr_hshift, verbose>1); + sws_chr_hshift, sws_chr_vshift, verbose>1);
switch(sws_flags)
and the hidden bugfix :)
sadly only half fix, iam still searching the other half ...
do you really believe you can escape from the 100l punishment? :)))
damn, i should have added more cosmetics :)
[...] cool, now I can use hshift for horizontal shifting instead of vertical, I
On Monday 03 November 2003 15:02, Michael Niedermayer wrote: thought you were too lazy to fix it, Michael? =) -- Best Regards, Atmos ____________________________________________ - MPlayer Developer - http://mplayerhq.hu/ - ____________________________________________
On Monday 03 November 2003 20:12, Felix Buenemann wrote:
On Monday 03 November 2003 15:02, Michael Niedermayer wrote:
Hi
On Monday 03 November 2003 14:50, Arpi wrote: [...]
@@ -437,7 +448,7 @@ src_filter= sws_getDefaultFilter( sws_lum_gblur, sws_chr_gblur, sws_lum_sharpen, sws_chr_sharpen, - sws_chr_vshift, sws_chr_hshift, verbose>1); + sws_chr_hshift, sws_chr_vshift, verbose>1);
switch(sws_flags)
and the hidden bugfix :)
sadly only half fix, iam still searching the other half ...
do you really believe you can escape from the 100l punishment? :)))
damn, i should have added more cosmetics :)
[...]
cool, now I can use hshift for horizontal shifting instead of vertical, I thought you were too lazy to fix it, Michael? =) seems it's the wrong half, -ssf cvs works as expected now, but -ssf chs does nothing. -- Best Regards, Atmos
- MPlayer Developer - http://mplayerhq.hu/ - ____________________________________________
On Tuesday 04 November 2003 11:15, Felix Buenemann wrote:
On Monday 03 November 2003 20:12, Felix Buenemann wrote:
On Monday 03 November 2003 15:02, Michael Niedermayer wrote:
Hi
On Monday 03 November 2003 14:50, Arpi wrote: [...]
@@ -437,7 +448,7 @@ src_filter= sws_getDefaultFilter( sws_lum_gblur, sws_chr_gblur, sws_lum_sharpen, sws_chr_sharpen, - sws_chr_vshift, sws_chr_hshift, verbose>1); + sws_chr_hshift, sws_chr_vshift, verbose>1);
switch(sws_flags)
and the hidden bugfix :)
sadly only half fix, iam still searching the other half ...
do you really believe you can escape from the 100l punishment? :)))
damn, i should have added more cosmetics :)
[...]
cool, now I can use hshift for horizontal shifting instead of vertical, I thought you were too lazy to fix it, Michael? =)
seems it's the wrong half, -ssf cvs works as expected now, but -ssf chs does nothing. I found the problematic code in swscale.c line 1931: #ifdef ARCH_X86 // can't downscale !!! if(c->canMMX2BeUsed && (flags & SWS_FAST_BILINEAR)) { c->lumMmx2Filter = (int16_t*)memalign(8, (dstW /8 +8)*sizeof(int16_t)); c->chrMmx2Filter = (int16_t*)memalign(8, (c->chrDstW /4 +8)*sizeof(int16_t)); c->lumMmx2FilterPos= (int32_t*)memalign(8, (dstW /2/8 +8)*sizeof(int32_t)); c->chrMmx2FilterPos= (int32_t*)memalign(8, (c->chrDstW/2/4 +8)*sizeof(int32_t));
initMMX2HScaler( dstW, c->lumXInc, c->funnyYCode , c->lumMmx2Filter, c->lumMmx2FilterPos, 8); initMMX2HScaler(c->chrDstW, c->chrXInc, c->funnyUVCode, c->chrMmx2Filter, c->chrMmx2FilterPos, 4); } #endif This breaks horizontal chroma shifting if -sws 0 is used (FastBilinear), eg. with -sws 2 (Bcubic) it works. -- Best Regards, Atmos ____________________________________________ - MPlayer Developer - http://mplayerhq.hu/ - ____________________________________________
On Mon, Nov 03, 2003 at 03:02:05PM +0100, Michael Niedermayer wrote:
Hi
On Monday 03 November 2003 14:50, Arpi wrote: [...]
@@ -437,7 +448,7 @@ src_filter= sws_getDefaultFilter( sws_lum_gblur, sws_chr_gblur, sws_lum_sharpen, sws_chr_sharpen, - sws_chr_vshift, sws_chr_hshift, verbose>1); + sws_chr_hshift, sws_chr_vshift, verbose>1);
switch(sws_flags)
and the hidden bugfix :) sadly only half fix, iam still searching the other half ...
do you really believe you can escape from the 100l punishment? :))) damn, i should have added more cosmetics :)
Or some additional "optimizations" like: - sws_lum_sharpen, sws_chr_sharpen, + sws_lum_sharpen, sws_chr_sharpen, :) Rich
participants (5)
-
Arpi -
D Richard Felker III -
Felix Buenemann -
Michael Niedermayer -
Michael Niedermayer CVS