avcodec/cavsdec: simplify % 512 operations