optimizing av_log2