avcodec/cavsdec: simplify % 512 operations

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swscale/swscale: replace potentially slow % by &

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>