AIRLegend / aitrack

6DoF Head tracking software
MIT License
1.03k stars 102 forks source link

some optimizations and jitter reduction #148

Closed searching46dof closed 1 year ago

searching46dof commented 2 years ago

OPTIMIZE_Facedata reduces malloc/memcpy from multiple std::string and std::to_string OPTIMIZE_MAFilter uses this->sum as a cache to optimize calculation of the average in MAFilter::filter added float suffix f to float constants to so that they are not double and calculations are not promoted to doubles to reduce conversions. OPTIMIZE_ImageProcessor combines normalize and transpose methods to combine their for loops FIX_logit_boundary_conditions modifies logit to consistently handle boundary conditions (e.g. > 0.99999f but less than 1.0f) fix all automatic type conversion warnings with typecasts so that the conversions are visible since they consume CPU. try to optimize typecast to use float computation but may use double computation in cases required for the target value type or library function parameter. OPTIMIZE_Tracker uses a reference to reduce array indexing OPTIMIZE_PositionSolver reduces the number of double computations by using int64_t computations instead. DEBUG_OUTPUT_FACE_DATA disables output to std::cout. FIX_WARNING_PositionSolver fixes a build warning but the original computation trucates the fractional portion. Was it intentional?

AIRLegend commented 2 years ago

Awesome! Thank you very much! ❤️