473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

substracting a lot of numbers optimisation

Hello,

I write a program which will stabilize a shaking video made with hand
camera. Of course it involves substracting frames, and it is substracting a
huge lot of one byte values.

The problem is that it takes a lot of time. To find out how was the camera
moved between two consecutive frames I have two substract that two frames
in all possible offsets (something like 40*40=1600 - I assume the camera
hasn't been moved more than 20 pixels in 1/25 s). And substracting two
frames is substracting 640*480*3 one byte values!

I guess it can be somehow optimised. For instance: using mencoder I can
encode videos to mpeg in real time, so probably they have some fast
method...

Does any of you have an idea how such substracting can be optimised?

--
Piotr Sobolewski http://www.rozrywka.jawsieci.pl/materialy/
http://www.wstepwolny.w.pl
http://www.rozrywka.jawsieci.pl/wstep_wolny/
Nov 14 '05 #1
1 1128
Piotr Sobolewski wrote:
Hello,

I write a program which will stabilize a shaking video made with hand
camera. Of course it involves substracting frames, and it is substracting a
huge lot of one byte values.

The problem is that it takes a lot of time. To find out how was the camera
moved between two consecutive frames I have two substract that two frames
in all possible offsets (something like 40*40=1600 - I assume the camera
hasn't been moved more than 20 pixels in 1/25 s). And substracting two
frames is substracting 640*480*3 one byte values!

I guess it can be somehow optimised. For instance: using mencoder I can
encode videos to mpeg in real time, so probably they have some fast
method...

Does any of you have an idea how such substracting can be optimised?


This isn't really on topic; you'll have a better chance of getting a
useful reply from a group that deals with digital video. Check out
dirac at http://directory.fsf.org/vid/dirac.html and ask the guys at
http://lists.sourceforge.net/lists/l.../dirac-discuss . fsf.org has
a number of other programs with source code avalable that deal with
video if you'd like to browse for ideas.

HTH
Nov 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon Elliott | last post by:
What optimisation do compilers typically provide when passing STL containers around? For example, if I do something like this: struct Tbloggs { std::string s1; }; typedef...
16
by: simonwittber | last post by:
Hello People. I've have a very tight inner loop (in a game app, so every millisecond counts) which I have optimised below: def loop(self): self_pool = self.pool self_call_exit_funcs =...
15
by: Darksun4 | last post by:
Hi all! I want to check whether a number is odd or even. I've made an algorithm but I believe there should be a faster one ( maybe a macro ). Here it goes : int iseven ( int number ) { int...
17
by: EC-AKD | last post by:
Hi All, I am new to the concept of optimising codes in C. I was wondering if C level inlining of code is any way comparable to macros. I believe that inlining is equivalent to writing macros....
89
by: purifier | last post by:
The problem is to write a program in 'C' to find the greatest of 2 given numbers... Easy? huh here's the catch do not use 'if' or any conditional statements if u want it to be a little more...
8
by: Jon Maz | last post by:
Hi, I'm facing a code-optimisation issue on an asp.net/vb.net/SQL Server 2000 project. A web page containing not much more than 3 DropDownLists is taking nigh on 6 seconds to load, because each...
1
by: David Welch | last post by:
Hi, I have a bit of code where I am relying on empty base member optimisation. The bit of code is below: template<typename Enum> struct EncodePrefix { template<Enum e> struct Apply
1
by: grid | last post by:
Hi, I was exploring the affect of cache on program performance/optimisation.Is it the compilers responsibility only to consider this kind of optimisation or the programmer can do his bit in this...
2
by: special_dragonfly | last post by:
Hello, I know this might be a little cheeky, and if it is, please say, but I need a little hand optimising some code. For the simple reason that this is 'company' code and I have no idea what I'm...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.