mpegvideo: Rework frame_size_alloc function