View Full Version : For a better crop
kassandro
14th July 2003, 10:48
If frames are not properly aligned, i.e. the address of the first pixel of a row is not a multiple of 16, than various filters, especially those which use sse are up to 20% slower. Most filters don't change alignment, but crop does it and usually crop is applied quite early leading even to more slowdown. I suggest do add an option like "align=16", to crop. Then crop has to do a bitblt if one wants to crop by an amount, which is not a multiple of 16.
sh0dan
14th July 2003, 19:58
Couldn't hurt. I'll try it out.
sh0dan
15th July 2003, 21:24
It will be in the next version. It's implemented as a bool for simplicity. It aligns if not 16 byte aligned on SSE2 capable machines and 8 byte aligned on other machines.
ARDA
16th July 2003, 21:47
a little off topic
@sh0dan
I've been playing a little with chromas in YV12; doing a plugin that
uses SSE2.
I was testing with an interlaced source and I applied my
filter after SeparateFields and before weave;it was then I
discovered that the inicial address was not 16 byte aligned
after SeparateFields.
I had been doing a lot of tests and in almost all situations,I had no problems
to be able to use movdqa to read or write (except crop ).There must be others
cases in which this problem appears;it would be usefull if you could point them.
By now I opened a branch verifying...if ( int (srcpu) & 15 || int (srcpv) & 15){}
and in such case went back to ISSE routine.
(it is less expensive than making a lot of controls).
asking?...or asking
Is it possible to make something similar you've done with crop yesterday?
Thanks in advance
Arda
sh0dan
16th July 2003, 21:58
I can sum up the safe things:
* pitch will be at least up to the next mod 16 (luma), mod 8 (chroma)
* env->NewVideoFrame(vi) will return a 16 byte aligned frame (pointer).
* env->NewVideoFrame(vi,32) will return a 32 (luma), 16 (chroma) byte aligned frame (pointer).
You can always create a new frame and BitBlt your material into that one (as I do in crop). You do however loose speed on that account too.
ARDA
17th July 2003, 08:16
@sh0dan
quote:
--------------------------------------------------------------------------------
Originally posted by ARDA
By now I opened a branch verifying...if ( int (srcpu) & 15 || int (srcpv) & 15){}
and in such case went back to ISSE routine.
(it is less expensive than making a lot of controls).
--------------------------------------------------------------------------------
quote:
--------------------------------------------------------------------------------
Originally posted by ARDA
Is it possible to make something similar you've done with crop yesterday?
--------------------------------------------------------------------------------
quote:
--------------------------------------------------------------------------------
Originally posted by sh0dan
You can always create a new frame and BitBlt your material into that one (as I do in crop).
You do however loose speed on that account too.
--------------------------------------------------------------------------------
Sorry, in my own post was the answer.I was waiting a miracle.
Thanks
Arda
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.