google-code-export / cortex-vfx

Automatically exported from code.google.com/p/cortex-vfx
0 stars 0 forks source link

OversamplesCalculator/InterpolatedCache improvements #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We need to sort out the rounding in OversamplesCalculator - some functions have 
rounding problems Andrew has observed, and another has deliberate rounding 
errors in an attempt to match Maya. We should ditch the Maya matching and sort 
out reliable rounding of our own. At the same time we should consider the todo 
in InterpolatedCache, where we pass something like an OversamplesCalculator to 
every read.

Original issue reported on code.google.com by john.ima...@gmail.com on 17 Feb 2011 at 1:19

GoogleCodeExporter commented 9 years ago

Original comment by john.ima...@gmail.com on 17 Feb 2011 at 1:19

GoogleCodeExporter commented 9 years ago
Here is some code to demonstrate the issue I was experiencing:

> o = IECore.OversamplesCalculator()
> o.framesToTicks( 10.2 )
2550
> o.framesToTicks( 10.4 )
2599

If I re-implement framesToTicks directly in python and add round(), I get the 
expected results:

> int( round( 10.2 * o.getTicksPerSecond() / o.getFrameRate() ) )
2550
> int( round( 10.4 * o.getTicksPerSecond() / o.getFrameRate() ) )
2600

However, adding the round() in c++ makes 10.4 convert to 2600 correctly, but 
10.2 converts to 2549.

Original comment by andrewk....@gmail.com on 17 Feb 2011 at 5:14