mWidth = mInPixelsAllocation.getType().getX();
mHeight = mInPixelsAllocation.getType().getY();
float scale = 1.f / 32.f;
Type t = Type.createXY(mRS, mInPixelsAllocation.getElement(),
(int)(mWidth * scale), (int)(mHeight * scale));
mScratchAllocation = Allocation.createTyped(mRS, t);
// make small buffer
mScript = new ScriptC_resize(mRS);
mScript.set_gIn(mInPixelsAllocation);
mScript.set_gWidthIn(mWidth);
mScript.set_gHeightIn(mHeight);
mScript.set_scale(1.f / scale);
mScript.forEach_nearest(mScratchAllocation);
// setup normal ops
mScript.set_gIn(mScratchAllocation);
mScript.set_gWidthIn(t.getX());
mScript.set_gHeightIn(t.getY());
mScript.set_scale(scale);
//mScript.forEach_nearest(mScratchAllocation);
mIntrinsic = ScriptIntrinsicResize.create(mRS);
mIntrinsic.setInput(mScratchAllocation);