h264: call alloc_scratch_buffers() only once linesize is known