2 * Intel MediaSDK QSV encoder/decoder shared code
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #include <mfx/mfxvideo.h>
22 #include <mfx/mfxplugin.h>
23 #include <mfx/mfxjpeg.h>
28 #include "libavutil/avstring.h"
29 #include "libavutil/common.h"
30 #include "libavutil/error.h"
31 #include "libavutil/hwcontext.h"
32 #include "libavutil/hwcontext_qsv.h"
33 #include "libavutil/imgutils.h"
34 #include "libavutil/avassert.h"
37 #include "qsv_internal.h"
39 #if QSV_VERSION_ATLEAST(1, 12)
40 #include "mfx/mfxvp8.h"
43 int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
46 case AV_CODEC_ID_H264:
48 #if QSV_VERSION_ATLEAST(1, 8)
49 case AV_CODEC_ID_HEVC:
50 return MFX_CODEC_HEVC;
52 case AV_CODEC_ID_MPEG1VIDEO:
53 case AV_CODEC_ID_MPEG2VIDEO:
54 return MFX_CODEC_MPEG2;
57 #if QSV_VERSION_ATLEAST(1, 12)
61 case AV_CODEC_ID_MJPEG:
62 return MFX_CODEC_JPEG;
67 return AVERROR(ENOSYS);
70 int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile)
72 if (profile == FF_PROFILE_UNKNOWN)
73 return MFX_PROFILE_UNKNOWN;
75 case AV_CODEC_ID_H264:
76 case AV_CODEC_ID_HEVC:
79 return 4 * profile + 1;
80 case AV_CODEC_ID_MPEG2VIDEO:
81 return 0x10 * profile;
83 return MFX_PROFILE_UNKNOWN;
91 { MFX_ERR_NONE, 0, "success" },
92 { MFX_ERR_UNKNOWN, AVERROR_UNKNOWN, "unknown error" },
93 { MFX_ERR_NULL_PTR, AVERROR(EINVAL), "NULL pointer" },
94 { MFX_ERR_UNSUPPORTED, AVERROR(ENOSYS), "unsupported" },
95 { MFX_ERR_MEMORY_ALLOC, AVERROR(ENOMEM), "failed to allocate memory" },
96 { MFX_ERR_NOT_ENOUGH_BUFFER, AVERROR(ENOMEM), "insufficient input/output buffer" },
97 { MFX_ERR_INVALID_HANDLE, AVERROR(EINVAL), "invalid handle" },
98 { MFX_ERR_LOCK_MEMORY, AVERROR(EIO), "failed to lock the memory block" },
99 { MFX_ERR_NOT_INITIALIZED, AVERROR_BUG, "not initialized" },
100 { MFX_ERR_NOT_FOUND, AVERROR(ENOSYS), "specified object was not found" },
101 /* the following 3 errors should always be handled explicitly, so those "mappings"
102 * are for completeness only */
103 { MFX_ERR_MORE_DATA, AVERROR_UNKNOWN, "expect more data at input" },
104 { MFX_ERR_MORE_SURFACE, AVERROR_UNKNOWN, "expect more surface at output" },
105 { MFX_ERR_MORE_BITSTREAM, AVERROR_UNKNOWN, "expect more bitstream at output" },
106 { MFX_ERR_ABORTED, AVERROR_UNKNOWN, "operation aborted" },
107 { MFX_ERR_DEVICE_LOST, AVERROR(EIO), "device lost" },
108 { MFX_ERR_INCOMPATIBLE_VIDEO_PARAM, AVERROR(EINVAL), "incompatible video parameters" },
109 { MFX_ERR_INVALID_VIDEO_PARAM, AVERROR(EINVAL), "invalid video parameters" },
110 { MFX_ERR_UNDEFINED_BEHAVIOR, AVERROR_BUG, "undefined behavior" },
111 { MFX_ERR_DEVICE_FAILED, AVERROR(EIO), "device failed" },
112 { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio parameters" },
113 { MFX_ERR_INVALID_AUDIO_PARAM, AVERROR(EINVAL), "invalid audio parameters" },
115 { MFX_WRN_IN_EXECUTION, 0, "operation in execution" },
116 { MFX_WRN_DEVICE_BUSY, 0, "device busy" },
117 { MFX_WRN_VIDEO_PARAM_CHANGED, 0, "video parameters changed" },
118 { MFX_WRN_PARTIAL_ACCELERATION, 0, "partial acceleration" },
119 { MFX_WRN_INCOMPATIBLE_VIDEO_PARAM, 0, "incompatible video parameters" },
120 { MFX_WRN_VALUE_NOT_CHANGED, 0, "value is saturated" },
121 { MFX_WRN_OUT_OF_RANGE, 0, "value out of range" },
122 { MFX_WRN_FILTER_SKIPPED, 0, "filter skipped" },
123 { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0, "incompatible audio parameters" },
126 int ff_qsv_map_error(mfxStatus mfx_err, const char **desc)
129 for (i = 0; i < FF_ARRAY_ELEMS(qsv_errors); i++) {
130 if (qsv_errors[i].mfxerr == mfx_err) {
132 *desc = qsv_errors[i].desc;
133 return qsv_errors[i].averr;
137 *desc = "unknown error";
138 return AVERROR_UNKNOWN;
141 int ff_qsv_print_error(void *log_ctx, mfxStatus err,
142 const char *error_string)
146 ret = ff_qsv_map_error(err, &desc);
147 av_log(log_ctx, AV_LOG_ERROR, "%s: %s (%d)\n", error_string, desc, err);
151 int ff_qsv_print_warning(void *log_ctx, mfxStatus err,
152 const char *warning_string)
156 ret = ff_qsv_map_error(err, &desc);
157 av_log(log_ctx, AV_LOG_WARNING, "%s: %s (%d)\n", warning_string, desc, err);
161 static enum AVPixelFormat qsv_map_fourcc(uint32_t fourcc)
164 case MFX_FOURCC_NV12: return AV_PIX_FMT_NV12;
165 case MFX_FOURCC_P010: return AV_PIX_FMT_P010;
166 case MFX_FOURCC_P8: return AV_PIX_FMT_PAL8;
168 return AV_PIX_FMT_NONE;
171 int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc)
174 case AV_PIX_FMT_YUV420P:
175 case AV_PIX_FMT_YUVJ420P:
176 case AV_PIX_FMT_NV12:
177 *fourcc = MFX_FOURCC_NV12;
178 return AV_PIX_FMT_NV12;
179 case AV_PIX_FMT_YUV420P10:
180 case AV_PIX_FMT_P010:
181 *fourcc = MFX_FOURCC_P010;
182 return AV_PIX_FMT_P010;
184 return AVERROR(ENOSYS);
188 int ff_qsv_find_surface_idx(QSVFramesContext *ctx, QSVFrame *frame)
191 for (i = 0; i < ctx->nb_mids; i++) {
192 QSVMid *mid = &ctx->mids[i];
193 if (mid->handle == frame->surface.Data.MemId)
199 enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type)
201 enum AVPictureType type = AV_PICTURE_TYPE_NONE;
202 switch (mfx_pic_type & 0x7) {
203 case MFX_FRAMETYPE_I:
204 if (mfx_pic_type & MFX_FRAMETYPE_S)
205 type = AV_PICTURE_TYPE_SI;
207 type = AV_PICTURE_TYPE_I;
209 case MFX_FRAMETYPE_B:
210 type = AV_PICTURE_TYPE_B;
212 case MFX_FRAMETYPE_P:
213 if (mfx_pic_type & MFX_FRAMETYPE_S)
214 type = AV_PICTURE_TYPE_SP;
216 type = AV_PICTURE_TYPE_P;
225 static int qsv_load_plugins(mfxSession session, const char *load_plugins,
228 if (!load_plugins || !*load_plugins)
231 while (*load_plugins) {
236 char *plugin = av_get_token(&load_plugins, ":");
238 return AVERROR(ENOMEM);
239 if (strlen(plugin) != 2 * sizeof(uid.Data)) {
240 av_log(logctx, AV_LOG_ERROR, "Invalid plugin UID length\n");
241 err = AVERROR(EINVAL);
242 goto load_plugin_fail;
245 for (i = 0; i < sizeof(uid.Data); i++) {
246 err = sscanf(plugin + 2 * i, "%2hhx", uid.Data + i);
248 av_log(logctx, AV_LOG_ERROR, "Invalid plugin UID\n");
249 err = AVERROR(EINVAL);
250 goto load_plugin_fail;
255 ret = MFXVideoUSER_Load(session, &uid, 1);
258 snprintf(errorbuf, sizeof(errorbuf),
259 "Could not load the requested plugin '%s'", plugin);
260 err = ff_qsv_print_error(logctx, ret, errorbuf);
261 goto load_plugin_fail;
276 int ff_qsv_init_internal_session(AVCodecContext *avctx, mfxSession *session,
277 const char *load_plugins)
279 mfxIMPL impl = MFX_IMPL_AUTO_ANY;
280 mfxVersion ver = { { QSV_VERSION_MINOR, QSV_VERSION_MAJOR } };
285 ret = MFXInit(impl, &ver, session);
287 return ff_qsv_print_error(avctx, ret,
288 "Error initializing an internal MFX session");
290 ret = qsv_load_plugins(*session, load_plugins, avctx);
292 av_log(avctx, AV_LOG_ERROR, "Error loading plugins\n");
296 MFXQueryIMPL(*session, &impl);
298 switch (MFX_IMPL_BASETYPE(impl)) {
299 case MFX_IMPL_SOFTWARE:
302 case MFX_IMPL_HARDWARE:
303 case MFX_IMPL_HARDWARE2:
304 case MFX_IMPL_HARDWARE3:
305 case MFX_IMPL_HARDWARE4:
306 desc = "hardware accelerated";
312 av_log(avctx, AV_LOG_VERBOSE,
313 "Initialized an internal MFX session using %s implementation\n",
319 static void mids_buf_free(void *opaque, uint8_t *data)
321 AVBufferRef *hw_frames_ref = opaque;
322 av_buffer_unref(&hw_frames_ref);
326 static AVBufferRef *qsv_create_mids(AVBufferRef *hw_frames_ref)
328 AVHWFramesContext *frames_ctx = (AVHWFramesContext*)hw_frames_ref->data;
329 AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx;
330 int nb_surfaces = frames_hwctx->nb_surfaces;
332 AVBufferRef *mids_buf, *hw_frames_ref1;
336 hw_frames_ref1 = av_buffer_ref(hw_frames_ref);
340 mids = av_mallocz_array(nb_surfaces, sizeof(*mids));
342 av_buffer_unref(&hw_frames_ref1);
346 mids_buf = av_buffer_create((uint8_t*)mids, nb_surfaces * sizeof(*mids),
347 mids_buf_free, hw_frames_ref1, 0);
349 av_buffer_unref(&hw_frames_ref1);
354 for (i = 0; i < nb_surfaces; i++) {
355 QSVMid *mid = &mids[i];
356 mid->handle = frames_hwctx->surfaces[i].Data.MemId;
357 mid->hw_frames_ref = hw_frames_ref1;
363 static int qsv_setup_mids(mfxFrameAllocResponse *resp, AVBufferRef *hw_frames_ref,
364 AVBufferRef *mids_buf)
366 AVHWFramesContext *frames_ctx = (AVHWFramesContext*)hw_frames_ref->data;
367 AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx;
368 QSVMid *mids = (QSVMid*)mids_buf->data;
369 int nb_surfaces = frames_hwctx->nb_surfaces;
372 // the allocated size of the array is two larger than the number of
373 // surfaces, we store the references to the frames context and the
374 // QSVMid array there
375 resp->mids = av_mallocz_array(nb_surfaces + 2, sizeof(*resp->mids));
377 return AVERROR(ENOMEM);
379 for (i = 0; i < nb_surfaces; i++)
380 resp->mids[i] = &mids[i];
381 resp->NumFrameActual = nb_surfaces;
383 resp->mids[resp->NumFrameActual] = (mfxMemId)av_buffer_ref(hw_frames_ref);
384 if (!resp->mids[resp->NumFrameActual]) {
385 av_freep(&resp->mids);
386 return AVERROR(ENOMEM);
389 resp->mids[resp->NumFrameActual + 1] = av_buffer_ref(mids_buf);
390 if (!resp->mids[resp->NumFrameActual + 1]) {
391 av_buffer_unref((AVBufferRef**)&resp->mids[resp->NumFrameActual]);
392 av_freep(&resp->mids);
393 return AVERROR(ENOMEM);
399 static mfxStatus qsv_frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req,
400 mfxFrameAllocResponse *resp)
402 QSVFramesContext *ctx = pthis;
405 /* this should only be called from an encoder or decoder and
406 * only allocates video memory frames */
407 if (!(req->Type & (MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET |
408 MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET)) ||
409 !(req->Type & (MFX_MEMTYPE_FROM_DECODE | MFX_MEMTYPE_FROM_ENCODE)))
410 return MFX_ERR_UNSUPPORTED;
412 if (req->Type & MFX_MEMTYPE_EXTERNAL_FRAME) {
413 /* external frames -- fill from the caller-supplied frames context */
414 AVHWFramesContext *frames_ctx = (AVHWFramesContext*)ctx->hw_frames_ctx->data;
415 AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx;
416 mfxFrameInfo *i = &req->Info;
417 mfxFrameInfo *i1 = &frames_hwctx->surfaces[0].Info;
419 if (i->Width > i1->Width || i->Height > i1->Height ||
420 i->FourCC != i1->FourCC || i->ChromaFormat != i1->ChromaFormat) {
421 av_log(ctx->logctx, AV_LOG_ERROR, "Mismatching surface properties in an "
422 "allocation request: %dx%d %d %d vs %dx%d %d %d\n",
423 i->Width, i->Height, i->FourCC, i->ChromaFormat,
424 i1->Width, i1->Height, i1->FourCC, i1->ChromaFormat);
425 return MFX_ERR_UNSUPPORTED;
428 ret = qsv_setup_mids(resp, ctx->hw_frames_ctx, ctx->mids_buf);
430 av_log(ctx->logctx, AV_LOG_ERROR,
431 "Error filling an external frame allocation request\n");
432 return MFX_ERR_MEMORY_ALLOC;
434 } else if (req->Type & MFX_MEMTYPE_INTERNAL_FRAME) {
435 /* internal frames -- allocate a new hw frames context */
436 AVHWFramesContext *ext_frames_ctx = (AVHWFramesContext*)ctx->hw_frames_ctx->data;
437 mfxFrameInfo *i = &req->Info;
439 AVBufferRef *frames_ref, *mids_buf;
440 AVHWFramesContext *frames_ctx;
441 AVQSVFramesContext *frames_hwctx;
443 frames_ref = av_hwframe_ctx_alloc(ext_frames_ctx->device_ref);
445 return MFX_ERR_MEMORY_ALLOC;
447 frames_ctx = (AVHWFramesContext*)frames_ref->data;
448 frames_hwctx = frames_ctx->hwctx;
450 frames_ctx->format = AV_PIX_FMT_QSV;
451 frames_ctx->sw_format = qsv_map_fourcc(i->FourCC);
452 frames_ctx->width = i->Width;
453 frames_ctx->height = i->Height;
454 frames_ctx->initial_pool_size = req->NumFrameSuggested;
456 frames_hwctx->frame_type = req->Type;
458 ret = av_hwframe_ctx_init(frames_ref);
460 av_log(ctx->logctx, AV_LOG_ERROR,
461 "Error initializing a frames context for an internal frame "
462 "allocation request\n");
463 av_buffer_unref(&frames_ref);
464 return MFX_ERR_MEMORY_ALLOC;
467 mids_buf = qsv_create_mids(frames_ref);
469 av_buffer_unref(&frames_ref);
470 return MFX_ERR_MEMORY_ALLOC;
473 ret = qsv_setup_mids(resp, frames_ref, mids_buf);
474 av_buffer_unref(&mids_buf);
475 av_buffer_unref(&frames_ref);
477 av_log(ctx->logctx, AV_LOG_ERROR,
478 "Error filling an internal frame allocation request\n");
479 return MFX_ERR_MEMORY_ALLOC;
482 return MFX_ERR_UNSUPPORTED;
488 static mfxStatus qsv_frame_free(mfxHDL pthis, mfxFrameAllocResponse *resp)
490 av_buffer_unref((AVBufferRef**)&resp->mids[resp->NumFrameActual]);
491 av_buffer_unref((AVBufferRef**)&resp->mids[resp->NumFrameActual + 1]);
492 av_freep(&resp->mids);
496 static mfxStatus qsv_frame_lock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
498 QSVMid *qsv_mid = mid;
499 AVHWFramesContext *hw_frames_ctx = (AVHWFramesContext*)qsv_mid->hw_frames_ref->data;
500 AVQSVFramesContext *hw_frames_hwctx = hw_frames_ctx->hwctx;
503 if (qsv_mid->locked_frame)
504 return MFX_ERR_UNDEFINED_BEHAVIOR;
506 /* Allocate a system memory frame that will hold the mapped data. */
507 qsv_mid->locked_frame = av_frame_alloc();
508 if (!qsv_mid->locked_frame)
509 return MFX_ERR_MEMORY_ALLOC;
510 qsv_mid->locked_frame->format = hw_frames_ctx->sw_format;
512 /* wrap the provided handle in a hwaccel AVFrame */
513 qsv_mid->hw_frame = av_frame_alloc();
514 if (!qsv_mid->hw_frame)
517 qsv_mid->hw_frame->data[3] = (uint8_t*)&qsv_mid->surf;
518 qsv_mid->hw_frame->format = AV_PIX_FMT_QSV;
520 // doesn't really matter what buffer is used here
521 qsv_mid->hw_frame->buf[0] = av_buffer_alloc(1);
522 if (!qsv_mid->hw_frame->buf[0])
525 qsv_mid->hw_frame->width = hw_frames_ctx->width;
526 qsv_mid->hw_frame->height = hw_frames_ctx->height;
528 qsv_mid->hw_frame->hw_frames_ctx = av_buffer_ref(qsv_mid->hw_frames_ref);
529 if (!qsv_mid->hw_frame->hw_frames_ctx)
532 qsv_mid->surf.Info = hw_frames_hwctx->surfaces[0].Info;
533 qsv_mid->surf.Data.MemId = qsv_mid->handle;
535 /* map the data to the system memory */
536 ret = av_hwframe_map(qsv_mid->locked_frame, qsv_mid->hw_frame,
537 AV_HWFRAME_MAP_DIRECT);
541 ptr->Pitch = qsv_mid->locked_frame->linesize[0];
542 ptr->Y = qsv_mid->locked_frame->data[0];
543 ptr->U = qsv_mid->locked_frame->data[1];
544 ptr->V = qsv_mid->locked_frame->data[1] + 1;
548 av_frame_free(&qsv_mid->hw_frame);
549 av_frame_free(&qsv_mid->locked_frame);
550 return MFX_ERR_MEMORY_ALLOC;
553 static mfxStatus qsv_frame_unlock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
555 QSVMid *qsv_mid = mid;
557 av_frame_free(&qsv_mid->locked_frame);
558 av_frame_free(&qsv_mid->hw_frame);
563 static mfxStatus qsv_frame_get_hdl(mfxHDL pthis, mfxMemId mid, mfxHDL *hdl)
565 QSVMid *qsv_mid = (QSVMid*)mid;
566 *hdl = qsv_mid->handle;
570 int ff_qsv_init_session_device(AVCodecContext *avctx, mfxSession *psession,
571 AVBufferRef *device_ref, const char *load_plugins)
573 static const mfxHandleType handle_types[] = {
574 MFX_HANDLE_VA_DISPLAY,
575 MFX_HANDLE_D3D9_DEVICE_MANAGER,
576 MFX_HANDLE_D3D11_DEVICE,
578 AVHWDeviceContext *device_ctx = (AVHWDeviceContext*)device_ref->data;
579 AVQSVDeviceContext *device_hwctx = device_ctx->hwctx;
580 mfxSession parent_session = device_hwctx->session;
585 mfxHDL handle = NULL;
586 mfxHandleType handle_type;
591 err = MFXQueryIMPL(parent_session, &impl);
592 if (err == MFX_ERR_NONE)
593 err = MFXQueryVersion(parent_session, &ver);
594 if (err != MFX_ERR_NONE)
595 return ff_qsv_print_error(avctx, err,
596 "Error querying the session attributes");
598 for (i = 0; i < FF_ARRAY_ELEMS(handle_types); i++) {
599 err = MFXVideoCORE_GetHandle(parent_session, handle_types[i], &handle);
600 if (err == MFX_ERR_NONE) {
601 handle_type = handle_types[i];
607 av_log(avctx, AV_LOG_VERBOSE, "No supported hw handle could be retrieved "
608 "from the session\n");
611 err = MFXInit(impl, &ver, &session);
612 if (err != MFX_ERR_NONE)
613 return ff_qsv_print_error(avctx, err,
614 "Error initializing a child MFX session");
617 err = MFXVideoCORE_SetHandle(session, handle_type, handle);
618 if (err != MFX_ERR_NONE)
619 return ff_qsv_print_error(avctx, err,
620 "Error setting a HW handle");
623 if (QSV_RUNTIME_VERSION_ATLEAST(ver, 1, 25)) {
624 err = MFXJoinSession(parent_session, session);
625 if (err != MFX_ERR_NONE)
626 return ff_qsv_print_error(avctx, err,
627 "Error joining session");
630 ret = qsv_load_plugins(session, load_plugins, avctx);
632 av_log(avctx, AV_LOG_ERROR, "Error loading plugins\n");
640 int ff_qsv_init_session_frames(AVCodecContext *avctx, mfxSession *psession,
641 QSVFramesContext *qsv_frames_ctx,
642 const char *load_plugins, int opaque)
644 mfxFrameAllocator frame_allocator = {
645 .pthis = qsv_frames_ctx,
646 .Alloc = qsv_frame_alloc,
647 .Lock = qsv_frame_lock,
648 .Unlock = qsv_frame_unlock,
649 .GetHDL = qsv_frame_get_hdl,
650 .Free = qsv_frame_free,
653 AVHWFramesContext *frames_ctx = (AVHWFramesContext*)qsv_frames_ctx->hw_frames_ctx->data;
654 AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx;
661 ret = ff_qsv_init_session_device(avctx, &session,
662 frames_ctx->device_ref, load_plugins);
667 qsv_frames_ctx->logctx = avctx;
669 /* allocate the memory ids for the external frames */
670 av_buffer_unref(&qsv_frames_ctx->mids_buf);
671 qsv_frames_ctx->mids_buf = qsv_create_mids(qsv_frames_ctx->hw_frames_ctx);
672 if (!qsv_frames_ctx->mids_buf)
673 return AVERROR(ENOMEM);
674 qsv_frames_ctx->mids = (QSVMid*)qsv_frames_ctx->mids_buf->data;
675 qsv_frames_ctx->nb_mids = frames_hwctx->nb_surfaces;
677 err = MFXVideoCORE_SetFrameAllocator(session, &frame_allocator);
678 if (err != MFX_ERR_NONE)
679 return ff_qsv_print_error(avctx, err,
680 "Error setting a frame allocator");