75 uintptr_t
i = (uintptr_t)*opaque;
80 *opaque = (
void *)(
i + 1);
123 const char *space_description)
130 "%s forces fixed primaries; retagging output from "
133 old_name ? old_name :
"unknown", new_name ? new_name :
"unknown");
136 "%s forces fixed primaries, which disagrees with "
137 "this input's %s primaries tag\n",
138 space_description, old_name ? old_name :
"unknown");
156 "This DXGI color space has no chroma entry other than "
157 "left-sited; the output will actually be left-sited\n");
163 "This DXGI color space has no chroma entry other than "
164 "left-sited, but this input is tagged with a different siting\n");
177 "HLG has no DXGI entry with any chroma siting other than "
178 "top-left; the output will actually be top-left-sited\n");
184 "HLG has no DXGI entry with any chroma siting other than "
185 "top-left, but this input is tagged with a different siting\n");
200 "DXGI BT.2020 only supports top-left/left chroma "
201 "siting; output will use one of those instead\n");
207 "DXGI BT.2020 only supports top-left/left chroma siting, "
208 "but this input is tagged with a different siting\n");
220 DXGI_COLOR_SPACE_TYPE *out_space)
228 "BT.2020 constant-luminance has no DXGI color space; "
229 "retagging output as bt2020nc\n");
233 "BT.2020 constant-luminance matrix has no DXGI color "
234 "space; cannot process this input without misinterpreting\n");
243 "%s matrix has no DXGI YCbCr color space; only BT.601, "
244 "BT.709 or BT.2020 are supported\n",
name ?
name :
"this");
253 "%s transfer has no DXGI YCbCr color space; only SDR "
254 "gamma, smpte2084 or HLG (arib-std-b67) are "
273 *out_space =
full_range ? DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
274 : DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020;
281 "HLG has no RGB DXGI color space; use a YUV "
282 "output format or a supported out_color_transfer\n");
285 "HLG transfer characteristic has no RGB DXGI color "
286 "space; this RGB input cannot be processed\n");
293 "Studio range linear RGB has no DXGI color "
294 "space; use out_range=full, or a non-linear "
295 "out_color_transfer (e.g. bt709)\n");
298 "Studio range linear RGB has no DXGI color "
299 "space; this input cannot be processed\n");
303 *out_space = DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709;
311 "%s transfer has no RGB DXGI color space; only "
312 "SDR gamma, linear or smpte2084 are "
313 "supported\n",
name ?
name :
"this");
317 if (primaries_is_2020) {
318 *out_space =
full_range ? DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020
319 : DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020;
322 *out_space =
full_range ? DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
323 : DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709;
330 "this RGB transfer characteristic");
343 "No full-range smpte2084 YCbCr DXGI color space "
344 "exists; cannot process this %s\n",
345 is_output ?
"output request" :
"input");
349 *out_space = want_topleft ? DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020
350 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020;
355 *out_space =
full_range ? DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020
356 : DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020;
361 "Full-range BT.2020 SDR has no top-left-sited "
362 "DXGI YCbCr color space\n");
367 "Full-range BT.2020 SDR has no top-left-sited DXGI "
368 "YCbCr color space; falling back to left-sited\n");
372 *out_space = DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020;
374 *out_space =
full_range ? DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020
375 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020;
386 "%s transfer has no BT.601 DXGI color space; use "
387 "out_color_matrix=bt2020nc or an SDR transfer\n",
391 "%s transfer has no BT.601 DXGI color space; this "
392 "input cannot be processed.\n",
400 *out_space =
full_range ? DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601
401 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601;
413 "DXGI's BT.601 color spaces cannot distinguish "
414 "PAL/NTSC primaries (%s input, %s output)\n",
415 in_name ? in_name :
"unknown", out_name ? out_name :
"unknown");
422 "BT.601 cannot change primaries; tagging output "
424 new_name ? new_name :
"unknown");
427 }
else if (!is_output) {
432 "BT.601 only represents PAL/NTSC primaries, "
433 "which disagrees with this input's %s tag\n",
434 old_name ? old_name :
"unknown");
442 "this BT.601 matrix");
452 "%s has no BT.709 DXGI space; use "
453 "out_color_matrix=bt2020nc or SDR\n",
457 "%s has no BT.709 DXGI space; retag/convert to "
458 "BT.2020 or SDR before %s\n",
467 *out_space =
full_range ? DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709
468 : DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709;
471 "the default BT.709 matrix");
482 case DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020:
483 case DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020:
484 case DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020:
485 case DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020:
486 case DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_TOPLEFT_P2020:
516 HANDLE fence_event, DWORD timeout_ms)
518 int has_deadline = (timeout_ms != INFINITE);
519 ULONGLONG deadline = 0;
521 if (ID3D12Fence_GetCompletedValue(fence) >= target)
524 if (FAILED(ID3D12Fence_SetEventOnCompletion(fence, target, fence_event)))
528 deadline = GetTickCount64() + timeout_ms;
533 if (wait_result == WAIT_OBJECT_0) {
534 if (ID3D12Fence_GetCompletedValue(fence) >= target)
537 ULONGLONG now = GetTickCount64();
540 timeout_ms = (DWORD)(deadline - now);
551 D3D12_RESOURCE_STATES state_before,
552 D3D12_RESOURCE_STATES state_after)
554 ID3D12Resource *resource =
frame->texture;
555 D3D12_RESOURCE_DESC
desc;
557 resource->lpVtbl->GetDesc(resource, &
desc);
559 for (
int p = 0; p < nb_planes; p++) {
560 D3D12_RESOURCE_BARRIER
b = {
561 .Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION,
562 .Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE,
564 .pResource = resource,
565 .Subresource =
frame->subresource_index + p *
desc.DepthOrArraySize,
566 .StateBefore = state_before,
567 .StateAfter = state_after
570 barriers[(*nb_barriers)++] =
b;
600 if (
ctx->extra_hw_frames > 0)
603 frames_hwctx = frames_ctx->
hwctx;
605 frames_hwctx->
resource_flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
606 frames_hwctx->
heap_flags = D3D12_HEAP_FLAG_NONE;
622 case D3D12_COMMAND_LIST_TYPE_DIRECT:
623 return (ID3D12CommandList *)cmd->list.graphics;
624 case D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS:
625 return (ID3D12CommandList *)cmd->list.video_process;
626#if HAVE_ID3D12VIDEOENCODECOMMANDLIST
627 case D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE:
628 return (ID3D12CommandList *)cmd->list.video_encode;
638 case D3D12_COMMAND_LIST_TYPE_DIRECT:
639 return ID3D12GraphicsCommandList_Reset(cmd->list.graphics, allocator,
NULL);
640 case D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS:
641 return ID3D12VideoProcessCommandList_Reset(cmd->list.video_process, allocator);
642#if HAVE_ID3D12VIDEOENCODECOMMANDLIST
643 case D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE:
644 return ID3D12VideoEncodeCommandList_Reset(cmd->list.video_encode, allocator);
654 case D3D12_COMMAND_LIST_TYPE_DIRECT:
655 return ID3D12GraphicsCommandList_Close(cmd->list.graphics);
656 case D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS:
657 return ID3D12VideoProcessCommandList_Close(cmd->list.video_process);
658#if HAVE_ID3D12VIDEOENCODECOMMANDLIST
659 case D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE:
660 return ID3D12VideoEncodeCommandList_Close(cmd->list.video_encode);
675 ID3D12CommandAllocator **ppAllocator)
680 if (
av_fifo_peek(cmd->allocator_queue, &allocator, 1, 0) >= 0) {
681 UINT64 completed = ID3D12Fence_GetCompletedValue(cmd->fence);
690 hr = ID3D12Device_CreateCommandAllocator(cmd->device, cmd->type,
691 &IID_ID3D12CommandAllocator, (
void **)ppAllocator);
707 int confirmed_done = cmd->fence && cmd->fence_event &&
710 if (confirmed_done) {
715 "Failed to queue a command allocator for later reuse\n");
724 int gpu_confirmed_done = 1;
728 if (cmd->gpu_work_submitted && cmd->queue && cmd->fence && cmd->fence_event) {
729 UINT64 drain_value = cmd->fence_value + 1;
731 gpu_confirmed_done = 0;
733 if (SUCCEEDED(ID3D12CommandQueue_Signal(cmd->queue, cmd->fence, drain_value))) {
736 cmd->fence_value = drain_value + 1;
737 completed = ID3D12Fence_GetCompletedValue(cmd->fence);
738 if (completed >= drain_value)
739 gpu_confirmed_done = 1;
742 cmd->fence_event, INFINITE);
745 if (!gpu_confirmed_done) {
746 HRESULT removed_reason = ID3D12Device_GetDeviceRemovedReason(cmd->device);
747 gpu_confirmed_done = FAILED(removed_reason);
748 if (gpu_confirmed_done)
750 "D3D12 device removed (HRESULT 0x%lX) while tearing "
751 "down %s\n", removed_reason,
ctx->filter->name);
755 if (!gpu_confirmed_done) {
757 "Could not confirm the GPU finished all %s work "
758 "during teardown\n",
ctx->filter->name);
763 if (cmd->fence_event) {
764 CloseHandle(cmd->fence_event);
765 cmd->fence_event =
NULL;
769 ID3D12Fence_Release(cmd->fence);
775 memset(&cmd->list, 0,
sizeof(cmd->list));
778 if (cmd->command_allocator) {
779 ID3D12CommandAllocator_Release(cmd->command_allocator);
780 cmd->command_allocator =
NULL;
783 if (cmd->allocator_queue) {
785 while (
av_fifo_read(cmd->allocator_queue, &allocator, 1) >= 0) {
793 ID3D12CommandQueue_Release(cmd->queue);
797 cmd->gpu_work_submitted = 0;
803 ID3D12Device *device, D3D12_COMMAND_LIST_TYPE
type)
811 case D3D12_COMMAND_LIST_TYPE_DIRECT:
812 list_iid = &IID_ID3D12GraphicsCommandList;
814 case D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS:
815 list_iid = &IID_ID3D12VideoProcessCommandList;
817#if HAVE_ID3D12VIDEOENCODECOMMANDLIST
818 case D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE:
819 list_iid = &IID_ID3D12VideoEncodeCommandList;
829 "Cannot configure a new D3D12 command queue\n");
833 cmd->device = device;
836 D3D12_COMMAND_QUEUE_DESC queue_desc = {
838 .Priority = D3D12_COMMAND_QUEUE_PRIORITY_NORMAL,
839 .Flags = D3D12_COMMAND_QUEUE_FLAG_NONE,
843 hr = ID3D12Device_CreateCommandQueue(cmd->device, &queue_desc, &IID_ID3D12CommandQueue, (
void **)&cmd->queue);
851 hr = ID3D12Device_CreateFence(cmd->device, 0, D3D12_FENCE_FLAG_NONE, &IID_ID3D12Fence, (
void **)&cmd->fence);
858 cmd->fence_value = 1;
859 cmd->fence_event = CreateEvent(
NULL, FALSE, FALSE,
NULL);
860 if (!cmd->fence_event) {
868 if (!cmd->allocator_queue) {
879 hr = ID3D12Device_CreateCommandList(
920 ID3D12CommandAllocator *command_allocator)
923 ID3D12CommandAllocator_Release(command_allocator);
928 ID3D12CommandAllocator *command_allocator =
NULL;
936 hr = ID3D12CommandAllocator_Reset(command_allocator);
939 ID3D12CommandAllocator_Release(command_allocator);
950 cmd->command_allocator = command_allocator;
965 if (ID3D12Fence_GetCompletedValue(other->
fence) >= last_value)
968 hr = ID3D12CommandQueue_Wait(cmd->queue, other->
fence, last_value);
973 cmd->gpu_work_submitted = 1;
980 if (!cmd->fence || cmd->fence_value <= 1)
984 cmd->fence_event, timeout_ms)) {
1006 hr = ID3D12CommandQueue_Wait(cmd->queue, d3d12_frame->
sync_ctx.
fence,
1012 cmd->gpu_work_submitted = 1;
1021 HRESULT removed_reason = ID3D12Device_GetDeviceRemovedReason(cmd->device);
1022 int gpu_confirmed_done = FAILED(removed_reason);
1024 if (gpu_confirmed_done) {
1026 "D3D12 device removed (HRESULT 0x%lX); frame "
1027 "resources are safe to release\n", removed_reason);
1028 }
else if (cmd->queue && cmd->fence && cmd->fence_event) {
1029 UINT64 last_resort = cmd->fence_value + 1;
1030 if (SUCCEEDED(ID3D12CommandQueue_Signal(cmd->queue, cmd->fence, last_resort))) {
1033 if (last_resort >= cmd->fence_value)
1034 cmd->fence_value = last_resort + 1;
1036 completed = ID3D12Fence_GetCompletedValue(cmd->fence);
1037 if (completed >= last_resort) {
1038 gpu_confirmed_done = 1;
1041 cmd->fence_event, 5000);
1042 if (!gpu_confirmed_done)
1044 "Post-failure GPU wait timed out; frame "
1045 "resources cannot be safely recycled\n");
1049 "Best-effort post-failure GPU sync Signal also "
1050 "failed; frame resources cannot be safely "
1055 "No fence/queue for post-failure GPU sync; frame "
1056 "resources cannot be safely recycled\n");
1059 return gpu_confirmed_done;
1067 .command_allocator = cmd->command_allocator,
1070 UINT64 next_output_fence_value, next_private_fence_value;
1071 int wait_enqueued = 0;
1077 cmd->command_allocator =
NULL;
1089 for (
int i = 0;
i < nb_inputs;
i++) {
1093 wait_enqueued |=
ret;
1103 ID3D12CommandQueue_ExecuteCommandLists(cmd->queue, 1, cmd_lists);
1104 cmd->gpu_work_submitted = 1;
1106 next_private_fence_value = cmd->fence_value;
1109 next_output_fence_value =
output_frame->sync_ctx.fence_value + 1;
1111 hr = ID3D12CommandQueue_Signal(cmd->queue,
output_frame->sync_ctx.fence,
1112 next_output_fence_value);
1118 output_frame->sync_ctx.fence_value = next_output_fence_value;
1121 hr = ID3D12CommandQueue_Signal(cmd->queue, cmd->fence, next_private_fence_value);
1131 for (
int i = 0;
i < nb_inputs;
i++) {
1149 "Abandoning this frame's input/output surfaces and "
1150 "command allocator without releasing them\n");
static const AVFilterPad inputs[]
static AVFormatContext * ctx
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define i(width, name, range_min, range_max)
static const D3D12FilterFormat d3d12_filter_formats[]
int ff_d3d12_cmd_uninit(AVFilterContext *ctx, D3D12CommandContext *cmd)
Wait for the GPU to finish all submitted work, then release all D3D12 objects and clear cmd->ready.
static void d3d12_cmd_force_reconfigure(AVFilterContext *ctx, D3D12CommandContext *cmd, ID3D12CommandAllocator *command_allocator)
AVRational ff_d3d12_filter_get_input_framerate(AVFilterContext *ctx, AVFilterLink *inlink, const AVFrame *in)
int ff_d3d12_filter_get_colorspace(AVFilterContext *ctx, int is_rgb, int is_output, enum AVColorSpace *spc, enum AVColorRange *range, enum AVColorPrimaries *primaries, enum AVColorTransferCharacteristic *trc, enum AVChromaLocation chroma_loc, enum AVColorPrimaries input_601_hint, DXGI_COLOR_SPACE_TYPE *out_space)
Map AVFrame color properties to a DXGI color space.
static ID3D12CommandList * d3d12_cmd_get_list(const D3D12CommandContext *cmd)
int ff_d3d12_cmd_sync(AVFilterContext *ctx, D3D12CommandContext *cmd, DWORD timeout_ms)
Wait on the CPU until the latest submission has completed.
static int d3d12_filter_known_sdr_trc(enum AVColorTransferCharacteristic trc)
int ff_d3d12_cmd_wait_context(AVFilterContext *ctx, D3D12CommandContext *cmd, const D3D12CommandContext *other)
Make the queue of cmd wait, on the GPU, until the latest submission of other has completed.
const D3D12FilterFormat * ff_d3d12_filter_format_from_dxgi(DXGI_FORMAT fmt)
static HRESULT d3d12_cmd_close_list(D3D12CommandContext *cmd)
static int d3d12_filter_reject_unrepresentable_siting_2020(AVFilterContext *ctx, int is_output, enum AVChromaLocation chroma_loc)
const D3D12FilterFormat * ff_d3d12_filter_format_from_pix_fmt(enum AVPixelFormat fmt)
static int d3d12_filter_reject_unrepresentable_nonleft(AVFilterContext *ctx, int is_output, enum AVChromaLocation chroma_loc)
int ff_d3d12_cmd_submit(AVFilterContext *ctx, D3D12CommandContext *cmd, AVFrame *const *inputs, int nb_inputs, AVFrame *output, int *frames_in_use)
Close and execute the command list.
int ff_d3d12_cmd_begin(AVFilterContext *ctx, D3D12CommandContext *cmd)
Get a command allocator the GPU is done with, and reset it together with the command list for recordi...
static void d3d12_cmd_free_input_refs(D3D12CommandAllocator *allocator)
int ff_d3d12_filter_wait_fence(ID3D12Fence *fence, UINT64 target, HANDLE fence_event, DWORD timeout_ms)
Wait until fence reaches target, or until timeout_ms expires.
int ff_d3d12_filter_init_output_frames(AVFilterContext *ctx, AVBufferRef *device_ref, enum AVPixelFormat sw_format, int width, int height, int initial_pool_size, AVBufferRef **frames_ref)
Allocate and initialize a pool of D3D12 frames that can be used as render targets.
static int d3d12_cmd_discard_command_allocator(D3D12CommandContext *cmd, AVFilterContext *ctx, D3D12CommandAllocator *allocator)
const D3D12FilterFormat * ff_d3d12_filter_format_iterate(void **opaque)
Iterate over all supported formats.
enum AVChromaLocation ff_d3d12_filter_chroma_location(DXGI_COLOR_SPACE_TYPE space)
static int d3d12_cmd_sync_after_failure(AVFilterContext *ctx, D3D12CommandContext *cmd)
static HRESULT d3d12_cmd_reset_list(D3D12CommandContext *cmd, ID3D12CommandAllocator *allocator)
static int d3d12_cmd_get_valid_command_allocator(D3D12CommandContext *cmd, AVFilterContext *ctx, ID3D12CommandAllocator **ppAllocator)
static int d3d12_filter_reject_unrepresentable_left(AVFilterContext *ctx, int is_output, enum AVChromaLocation chroma_loc)
static int d3d12_filter_reconcile_primaries(AVFilterContext *ctx, int is_output, enum AVColorPrimaries *primaries, enum AVColorPrimaries expected_primaries, const char *space_description)
void ff_d3d12_filter_add_frame_barriers(D3D12_RESOURCE_BARRIER *barriers, int *nb_barriers, const AVD3D12VAFrame *frame, int nb_planes, D3D12_RESOURCE_STATES state_before, D3D12_RESOURCE_STATES state_after)
Append one transition barrier per plane of a D3D12 frame.
static int d3d12_filter_known_matrix(enum AVColorSpace spc)
static int d3d12_cmd_wait_frame(AVFilterContext *ctx, D3D12CommandContext *cmd, const AVFrame *frame, const char *fence_name)
int ff_d3d12_cmd_init(AVFilterContext *ctx, D3D12CommandContext *cmd, ID3D12Device *device, D3D12_COMMAND_LIST_TYPE type)
Create the command queue, the fence and a closed command list of the given type, after releasing any ...
#define D3D12_FILTER_MAX_INPUTS
Maximum number of input frames (including reference frames) that one submission can read.
@ DXGI_FORMAT_B8G8R8A8_UNORM
@ DXGI_FORMAT_R16G16B16A16_FLOAT
@ DXGI_FORMAT_R8G8B8A8_UNORM
static enum AVPixelFormat pix_fmt
reference-counted frame API
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
#define AVERROR_EXTERNAL
Generic error in an external library.
AVFifo * av_fifo_alloc2(size_t nb_elems, size_t elem_size, unsigned int flags)
Allocate and initialize an AVFifo with a given element size.
void av_fifo_freep2(AVFifo **f)
Free an AVFifo and reset pointer to NULL.
#define AV_FIFO_FLAG_AUTO_GROW
Automatically resize the FIFO on writes, so that the data fits.
int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset)
Read data from a FIFO without modifying FIFO state.
int av_fifo_write(AVFifo *f, const void *buf, size_t nb_elems)
Write data into a FIFO.
int av_fifo_read(AVFifo *f, void *buf, size_t nb_elems)
Read data from a FIFO.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
An API-specific header for AV_HWDEVICE_TYPE_D3D12VA.
const VDPAUPixFmtMap * map
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
static FilterLink * ff_filter_link(AVFilterLink *link)
const char * av_color_space_name(enum AVColorSpace space)
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
AVChromaLocation
Location of chroma samples.
@ AVCHROMA_LOC_TOPLEFT
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
@ AVCHROMA_LOC_LEFT
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
@ AVCHROMA_LOC_UNSPECIFIED
#define AV_PIX_FMT_RGBAF16
AVColorRange
Visual content value range.
@ AVCOL_RANGE_JPEG
Full range content.
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
@ AV_PIX_FMT_D3D12
Hardware surfaces for Direct3D 12.
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define AV_PIX_FMT_X2BGR10
AVColorPrimaries
Chromaticity coordinates of the source primaries.
@ AVCOL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
@ AVCOL_PRI_BT2020
ITU-R BT2020.
AVColorTransferCharacteristic
Color Transfer Characteristic.
@ AVCOL_TRC_SMPTE170M
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
@ AVCOL_TRC_BT2020_12
ITU-R BT2020 for 12-bit system.
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
@ AVCOL_TRC_BT2020_10
ITU-R BT2020 for 10-bit system.
@ AVCOL_TRC_BT709
also ITU-R BT1361
AVColorSpace
YUV colorspace type.
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
@ AVCOL_SPC_BT2020_CL
ITU-R BT2020 constant luminance system.
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
#define FF_ARRAY_ELEMS(a)
A reference to a data buffer.
D3D12VA frame descriptor for pool allocation.
AVD3D12VASyncContext sync_ctx
The sync context for the texture.
This struct is allocated as AVHWFramesContext.hwctx.
D3D12_RESOURCE_FLAGS resource_flags
Options for working with resources.
D3D12_HEAP_FLAGS heap_flags
Options for working with heaps allocation when creating resources.
DXGI_FORMAT format
DXGI_FORMAT format.
ID3D12Fence * fence
D3D12 fence object.
uint64_t fence_value
The fence value used for sync.
A link between two filters.
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int64_t duration
Duration of the frame, in the same units as pts.
This struct describes a set or pool of "hardware" frames (i.e.
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
void * hwctx
The format-specific data, allocated and freed automatically along with this context.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
int initial_pool_size
Initial size of the frame pool.
int width
The allocated dimensions of the frames in this pool.
Rational number (pair of numerator and denominator).
ID3D12CommandAllocator * command_allocator
AVFrame * input_refs[D3D12_FILTER_MAX_INPUTS]
One command queue with its command list, a pool of command allocators and a private fence.
Link properties exposed to filter code, but not external callers.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
static int ref[MAX_W *MAX_W]
static const Range full_range
#define WaitForSingleObject(a, b)