vcodec/agm: Alloc based on coded dimensions