slowly uncommenting hogCell()
indexing hogCell compiles
segfault in hogCell() ... debugging
using padded indexing now, where appropriate. still getting a segfault.
clamping, but still getting segfault. maybe the output address is wrong?
yeah, it's the output address that crashes us
hmm. hogX=0 is crashing us. when outputting.
confirmed that the problem isn't in dereferencing ori and mag images
yeah, hogX=0, hogY=27 is the size that's killing us
ok, hogOutputIdx = hogY_internal * hogResult.paddedWidth * hogResult.depth; works. But, hogOutputIdx = hogY_internal * hogResult.paddedWidth * hogResult.depth  +    hogX_internal * hogResult.depth; crashes
when I remove the 'hogX' portion of the indexing, we crash at hogX=0,hogY=28 ... instead of previously, hogX=0,hogY=27.
i guess oriBin_signed isn't to blame either ... if we get rid of the extra oriBin_signed offset, we still crash in the same place
aha, forgot sizeof(float) in malloc
now, segfault when reading data from hog imgs...
aha, i had turned off clamping. turned clamping back on; looks good.
casually looking at perf and where time is going
this smells very memory bound...getting rid of divisions by sbin makes no difference in terms of perf
explaining indexing in comments
interesting -- hogResult.hog[hogOutputIdx + oriBin_signed] += mag; takes 15ms (including lots of other stuff in the algo). doing this with mag * weightX * weightY bumps us up to 19ms. maybe precomputing weightX*weightY would help?
again, removing division doesnt make a difference for speed