History

avfilter: Add tonemap vaapi filter for H2S

It performs HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping. It only supports HDR10 as input temporarily. An example command to use this filter with vaapi codecs: FFMPEG -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi \ -i INPUT -vf 'tonemap_vaapi=format=p010' -c:v hevc_vaapi -profile 2 OUTPUT

Xinpeng Sun committed 6 years ago

Commit 2e2dfe61 parent 9f6a06d6 files · +483 −1Browse files

Unified · Split

6 files
  1. configure +2 −0
  2. doc/filters.texi +59 −0
  3. libavfilter/Makefile +1 −0
  4. libavfilter/allfilters.c +1 −0
  5. libavfilter/version.h +1 −1
  6. libavfilter/vf_tonemap_vaapi.c +419 −0
configure+2−0
@@ -3578,6 +3578,7 @@ tinterlace_filter_deps="gpl" · 3577 unmodified lines
3578tinterlace_merge_test_deps="tinterlace_filter"3578tinterlace_merge_test_deps="tinterlace_filter"
3579tinterlace_pad_test_deps="tinterlace_filter"3579tinterlace_pad_test_deps="tinterlace_filter"
3580tonemap_filter_deps="const_nan"3580tonemap_filter_deps="const_nan"
3581tonemap_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer_output_hdr_metadata"
3581tonemap_opencl_filter_deps="opencl const_nan"3582tonemap_opencl_filter_deps="opencl const_nan"
3582transpose_opencl_filter_deps="opencl"3583transpose_opencl_filter_deps="opencl"
3583transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"3584transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
@@ -6581,6 +6582,7 @@ if enabled vaapi; then · 2997 unmodified lines
6581 6582
6582 check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"6583 check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
6583 check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth6584 check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
6585 check_struct "va/va.h va/va_vpp.h" "VAProcPipelineParameterBuffer" output_hdr_metadata
6584 check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags6586 check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags
6585 check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"6587 check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
6586 check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"6588 check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
doc/filters.texi+59−0
@@ -21039,6 +21039,65 @@ Apply a strong blur of both luma and chroma parameters: · 21038 unmodified lines
21039 21039
21040@c man end OPENCL VIDEO FILTERS21040@c man end OPENCL VIDEO FILTERS
21041 21041
21042@chapter VAAPI Video Filters
21043@c man begin VAAPI VIDEO FILTERS
21044
21045VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
21046
21047To enable compilation of these filters you need to configure FFmpeg with
21048@code{--enable-vaapi}.
21049
21050To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read @url{https://trac.ffmpeg.org/wiki/Hardware/VAAPI}
21051
21052@section tonemap_vappi
21053
21054Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping.
21055It maps the dynamic range of HDR10 content to the SDR content.
21056It currently only accepts HDR10 as input.
21057
21058It accepts the following parameters:
21059
21060@table @option
21061@item format
21062Specify the output pixel format.
21063
21064Currently supported formats are:
21065@table @var
21066@item p010
21067@item nv12
21068@end table
21069
21070Default is nv12.
21071
21072@item primaries, p
21073Set the output color primaries.
21074
21075Default is same as input.
21076
21077@item transfer, t
21078Set the output transfer characteristics.
21079
21080Default is bt709.
21081
21082@item matrix, m
21083Set the output colorspace matrix.
21084
21085Default is same as input.
21086
21087@end table
21088
21089@subsection Example
21090
21091@itemize
21092@item
21093Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
21094@example
21095tonemap_vaapi=format=p010:t=bt2020-10
21096@end example
21097@end itemize
21098
21099@c man end VAAPI VIDEO FILTERS
21100
21042@chapter Video Sources21101@chapter Video Sources
21043@c man begin VIDEO SOURCES21102@c man begin VIDEO SOURCES
21044 21103
libavfilter/Makefile+1−0
@@ -411,6 +411,7 @@ OBJS-$(CONFIG_TMIX_FILTER) += vf_mix.o framesync.o · 410 unmodified lines
411OBJS-$(CONFIG_TONEMAP_FILTER) += vf_tonemap.o colorspace.o411OBJS-$(CONFIG_TONEMAP_FILTER) += vf_tonemap.o colorspace.o
412OBJS-$(CONFIG_TONEMAP_OPENCL_FILTER) += vf_tonemap_opencl.o colorspace.o opencl.o \412OBJS-$(CONFIG_TONEMAP_OPENCL_FILTER) += vf_tonemap_opencl.o colorspace.o opencl.o \
413 opencl/tonemap.o opencl/colorspace_common.o413 opencl/tonemap.o opencl/colorspace_common.o
414OBJS-$(CONFIG_TONEMAP_VAAPI_FILTER) += vf_tonemap_vaapi.o vaapi_vpp.o
414OBJS-$(CONFIG_TPAD_FILTER) += vf_tpad.o415OBJS-$(CONFIG_TPAD_FILTER) += vf_tpad.o
415OBJS-$(CONFIG_TRANSPOSE_FILTER) += vf_transpose.o416OBJS-$(CONFIG_TRANSPOSE_FILTER) += vf_transpose.o
416OBJS-$(CONFIG_TRANSPOSE_NPP_FILTER) += vf_transpose_npp.o417OBJS-$(CONFIG_TRANSPOSE_NPP_FILTER) += vf_transpose_npp.o
libavfilter/allfilters.c+1−0
@@ -391,6 +391,7 @@ extern AVFilter ff_vf_tlut2; · 390 unmodified lines
391extern AVFilter ff_vf_tmix;391extern AVFilter ff_vf_tmix;
392extern AVFilter ff_vf_tonemap;392extern AVFilter ff_vf_tonemap;
393extern AVFilter ff_vf_tonemap_opencl;393extern AVFilter ff_vf_tonemap_opencl;
394extern AVFilter ff_vf_tonemap_vaapi;
394extern AVFilter ff_vf_tpad;395extern AVFilter ff_vf_tpad;
395extern AVFilter ff_vf_transpose;396extern AVFilter ff_vf_transpose;
396extern AVFilter ff_vf_transpose_npp;397extern AVFilter ff_vf_transpose_npp;
libavfilter/version.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include "libavutil/version.h"30#include "libavutil/version.h"
31 31
32#define LIBAVFILTER_VERSION_MAJOR 732#define LIBAVFILTER_VERSION_MAJOR 7
33#define LIBAVFILTER_VERSION_MINOR 6833#define LIBAVFILTER_VERSION_MINOR 69
34#define LIBAVFILTER_VERSION_MICRO 10134#define LIBAVFILTER_VERSION_MICRO 101
35 35
36 36
libavfilter/vf_tonemap_vaapi.c+419−0
@@ -0,0 +1,419 @@
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#include <string.h>
19
20#include "libavutil/avassert.h"
21#include "libavutil/mem.h"
22#include "libavutil/opt.h"
23#include "libavutil/pixdesc.h"
24#include "libavutil/mastering_display_metadata.h"
25
26#include "avfilter.h"
27#include "formats.h"
28#include "internal.h"
29#include "vaapi_vpp.h"
30
31typedef struct HDRVAAPIContext {
32 VAAPIVPPContext vpp_ctx; // must be the first field
33
34 char *output_format_string;
35
36 char *color_primaries_string;
37 char *color_transfer_string;
38 char *color_matrix_string;
39
40 enum AVColorPrimaries color_primaries;
41 enum AVColorTransferCharacteristic color_transfer;
42 enum AVColorSpace color_matrix;
43
44 VAHdrMetaDataHDR10 in_metadata;
45
46 AVFrameSideData *src_display;
47 AVFrameSideData *src_light;
48} HDRVAAPIContext;
49
50static int tonemap_vaapi_save_metadata(AVFilterContext *avctx, AVFrame *input_frame)
51{
52 HDRVAAPIContext *ctx = avctx->priv;
53 AVMasteringDisplayMetadata *hdr_meta;
54 AVContentLightMetadata *light_meta;
55
56 if (input_frame->color_trc != AVCOL_TRC_SMPTE2084) {
57 av_log(avctx, AV_LOG_WARNING, "Only support HDR10 as input for vaapi tone-mapping\n");
58 }
59
60 ctx->src_display = av_frame_get_side_data(input_frame,
61 AV_FRAME_DATA_MASTERING_DISPLAY_METADATA);
62 if (ctx->src_display) {
63 hdr_meta = (AVMasteringDisplayMetadata *)ctx->src_display->data;
64 if (!hdr_meta) {
65 av_log(avctx, AV_LOG_ERROR, "No mastering display data\n");
66 return AVERROR(EINVAL);
67 }
68
69 if (hdr_meta->has_luminance) {
70 const int luma_den = 10000;
71 ctx->in_metadata.max_display_mastering_luminance =
72 lrint(luma_den * av_q2d(hdr_meta->max_luminance));
73 ctx->in_metadata.min_display_mastering_luminance =
74 FFMIN(lrint(luma_den * av_q2d(hdr_meta->min_luminance)),
75 ctx->in_metadata.max_display_mastering_luminance);
76
77 av_log(avctx, AV_LOG_DEBUG,
78 "Mastering Display Metadata(in luminance):\n");
79 av_log(avctx, AV_LOG_DEBUG,
80 "min_luminance=%u, max_luminance=%u\n",
81 ctx->in_metadata.min_display_mastering_luminance,
82 ctx->in_metadata.max_display_mastering_luminance);
83 }
84
85 if (hdr_meta->has_primaries) {
86 int i;
87 const int mapping[3] = {1, 2, 0}; //green, blue, red
88 const int chroma_den = 50000;
89
90 for (i = 0; i < 3; i++) {
91 const int j = mapping[i];
92 ctx->in_metadata.display_primaries_x[i] =
93 FFMIN(lrint(chroma_den *
94 av_q2d(hdr_meta->display_primaries[j][0])),
95 chroma_den);
96 ctx->in_metadata.display_primaries_y[i] =
97 FFMIN(lrint(chroma_den *
98 av_q2d(hdr_meta->display_primaries[j][1])),
99 chroma_den);
100 }
101
102 ctx->in_metadata.white_point_x =
103 FFMIN(lrint(chroma_den * av_q2d(hdr_meta->white_point[0])),
104 chroma_den);
105 ctx->in_metadata.white_point_y =
106 FFMIN(lrint(chroma_den * av_q2d(hdr_meta->white_point[1])),
107 chroma_den);
108
109 av_log(avctx, AV_LOG_DEBUG,
110 "Mastering Display Metadata(in primaries):\n");
111 av_log(avctx, AV_LOG_DEBUG,
112 "G(%u,%u) B(%u,%u) R(%u,%u) WP(%u,%u)\n",
113 ctx->in_metadata.display_primaries_x[0],
114 ctx->in_metadata.display_primaries_y[0],
115 ctx->in_metadata.display_primaries_x[1],
116 ctx->in_metadata.display_primaries_y[1],
117 ctx->in_metadata.display_primaries_x[2],
118 ctx->in_metadata.display_primaries_y[2],
119 ctx->in_metadata.white_point_x,
120 ctx->in_metadata.white_point_y);
121 }
122 } else {
123 av_log(avctx, AV_LOG_ERROR, "No mastering display data from input\n");
124 return AVERROR(EINVAL);
125 }
126
127 ctx->src_light = av_frame_get_side_data(input_frame,
128 AV_FRAME_DATA_CONTENT_LIGHT_LEVEL);
129 if (ctx->src_light) {
130 light_meta = (AVContentLightMetadata *)ctx->src_light->data;
131 if (!light_meta) {
132 av_log(avctx, AV_LOG_ERROR, "No light metadata\n");
133 return AVERROR(EINVAL);
134 }
135
136 ctx->in_metadata.max_content_light_level = light_meta->MaxCLL;
137 ctx->in_metadata.max_pic_average_light_level = light_meta->MaxFALL;
138
139 av_log(avctx, AV_LOG_DEBUG,
140 "Mastering Content Light Level (in):\n");
141 av_log(avctx, AV_LOG_DEBUG,
142 "MaxCLL(%u) MaxFALL(%u)\n",
143 ctx->in_metadata.max_content_light_level,
144 ctx->in_metadata.max_pic_average_light_level);
145 } else {
146 av_log(avctx, AV_LOG_DEBUG, "No content light level from input\n");
147 }
148 return 0;
149}
150
151static int tonemap_vaapi_set_filter_params(AVFilterContext *avctx, AVFrame *input_frame)
152{
153 VAAPIVPPContext *vpp_ctx = avctx->priv;
154 HDRVAAPIContext *ctx = avctx->priv;
155 VAStatus vas;
156 VAProcFilterParameterBufferHDRToneMapping *hdrtm_param;
157
158 vas = vaMapBuffer(vpp_ctx->hwctx->display, vpp_ctx->filter_buffers[0],
159 (void**)&hdrtm_param);
160 if (vas != VA_STATUS_SUCCESS) {
161 av_log(avctx, AV_LOG_ERROR, "Failed to map "
162 "buffer (%d): %d (%s).\n",
163 vpp_ctx->filter_buffers[0], vas, vaErrorStr(vas));
164 return AVERROR(EIO);
165 }
166
167 memcpy(hdrtm_param->data.metadata, &ctx->in_metadata, sizeof(VAHdrMetaDataHDR10));
168
169 vas = vaUnmapBuffer(vpp_ctx->hwctx->display, vpp_ctx->filter_buffers[0]);
170 if (vas != VA_STATUS_SUCCESS) {
171 av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: "
172 "%d (%s).\n", vas, vaErrorStr(vas));
173 return AVERROR(EIO);
174 }
175
176 return 0;
177}
178
179static int tonemap_vaapi_build_filter_params(AVFilterContext *avctx)
180{
181 VAAPIVPPContext *vpp_ctx = avctx->priv;
182 HDRVAAPIContext *ctx = avctx->priv;
183 VAStatus vas;
184 VAProcFilterParameterBufferHDRToneMapping hdrtm_param;
185 VAProcFilterCapHighDynamicRange hdr_cap[VAProcHighDynamicRangeMetadataTypeCount];
186 int num_query_caps;
187 int i;
188
189 memset(&hdrtm_param, 0, sizeof(hdrtm_param));
190 memset(&ctx->in_metadata, 0, sizeof(ctx->in_metadata));
191
192 num_query_caps = VAProcHighDynamicRangeMetadataTypeCount;
193 vas = vaQueryVideoProcFilterCaps(vpp_ctx->hwctx->display,
194 vpp_ctx->va_context,
195 VAProcFilterHighDynamicRangeToneMapping,
196 &hdr_cap, &num_query_caps);
197 if (vas != VA_STATUS_SUCCESS) {
198 av_log(avctx, AV_LOG_ERROR, "Failed to query HDR caps "
199 "context: %d (%s).\n", vas, vaErrorStr(vas));
200 return AVERROR(EIO);
201 }
202
203 for (i = 0; i < num_query_caps; i++) {
204 if (hdr_cap[i].metadata_type != VAProcHighDynamicRangeMetadataNone)
205 break;
206 }
207
208 if (i >= num_query_caps) {
209 av_log(avctx, AV_LOG_ERROR, "VAAPI driver doesn't support HDR\n");
210 return AVERROR(EINVAL);
211 }
212
213 for (i = 0; i < num_query_caps; i++) {
214 if (VA_TONE_MAPPING_HDR_TO_SDR & hdr_cap[i].caps_flag)
215 break;
216 }
217
218 if (i >= num_query_caps) {
219 av_log(avctx, AV_LOG_ERROR,
220 "VAAPI driver doesn't support HDR to SDR\n");
221 return AVERROR(EINVAL);
222 }
223
224 hdrtm_param.type = VAProcFilterHighDynamicRangeToneMapping;
225 hdrtm_param.data.metadata_type = VAProcHighDynamicRangeMetadataHDR10;
226 hdrtm_param.data.metadata = &ctx->in_metadata;
227 hdrtm_param.data.metadata_size = sizeof(VAHdrMetaDataHDR10);
228
229 return ff_vaapi_vpp_make_param_buffers(avctx,
230 VAProcFilterParameterBufferType,
231 &hdrtm_param, sizeof(hdrtm_param), 1);
232}
233
234static int tonemap_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
235{
236 AVFilterContext *avctx = inlink->dst;
237 AVFilterLink *outlink = avctx->outputs[0];
238 VAAPIVPPContext *vpp_ctx = avctx->priv;
239 HDRVAAPIContext *ctx = avctx->priv;
240 AVFrame *output_frame = NULL;
241 VASurfaceID input_surface, output_surface;
242
243 VAProcPipelineParameterBuffer params;
244 int err;
245
246 av_log(avctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
247 av_get_pix_fmt_name(input_frame->format),
248 input_frame->width, input_frame->height, input_frame->pts);
249
250 if (vpp_ctx->va_context == VA_INVALID_ID){
251 av_frame_free(&input_frame);
252 return AVERROR(EINVAL);
253 }
254
255 err = tonemap_vaapi_save_metadata(avctx, input_frame);
256 if (err < 0)
257 goto fail;
258
259 err = tonemap_vaapi_set_filter_params(avctx, input_frame);
260 if (err < 0)
261 goto fail;
262
263 input_surface = (VASurfaceID)(uintptr_t)input_frame->data[3];
264 av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for tonemap vpp input.\n",
265 input_surface);
266
267 output_frame = ff_get_video_buffer(outlink, vpp_ctx->output_width,
268 vpp_ctx->output_height);
269 if (!output_frame) {
270 err = AVERROR(ENOMEM);
271 goto fail;
272 }
273
274 output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3];
275 av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for tonemap vpp output.\n",
276 output_surface);
277 memset(&params, 0, sizeof(params));
278
279 err = av_frame_copy_props(output_frame, input_frame);
280 if (err < 0)
281 return err;
282
283 if (ctx->color_primaries != AVCOL_PRI_UNSPECIFIED)
284 output_frame->color_primaries = ctx->color_primaries;
285
286 if (ctx->color_transfer != AVCOL_TRC_UNSPECIFIED)
287 output_frame->color_trc = ctx->color_transfer;
288 else
289 output_frame->color_trc = AVCOL_TRC_BT709;
290
291 if (ctx->color_matrix != AVCOL_SPC_UNSPECIFIED)
292 output_frame->colorspace = ctx->color_matrix;
293
294 err = ff_vaapi_vpp_init_params(avctx, &params,
295 input_frame, output_frame);
296 if (err < 0)
297 goto fail;
298
299 err = ff_vaapi_vpp_render_picture(avctx, &params, output_frame);
300 if (err < 0)
301 goto fail;
302
303 av_frame_free(&input_frame);
304
305 av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
306 av_get_pix_fmt_name(output_frame->format),
307 output_frame->width, output_frame->height, output_frame->pts);
308
309 return ff_filter_frame(outlink, output_frame);
310
311fail:
312 av_frame_free(&input_frame);
313 av_frame_free(&output_frame);
314 return err;
315}
316
317static av_cold int tonemap_vaapi_init(AVFilterContext *avctx)
318{
319 VAAPIVPPContext *vpp_ctx = avctx->priv;
320 HDRVAAPIContext *ctx = avctx->priv;
321
322 ff_vaapi_vpp_ctx_init(avctx);
323 vpp_ctx->build_filter_params = tonemap_vaapi_build_filter_params;
324 vpp_ctx->pipeline_uninit = ff_vaapi_vpp_pipeline_uninit;
325
326 if (ctx->output_format_string) {
327 vpp_ctx->output_format = av_get_pix_fmt(ctx->output_format_string);
328 switch (vpp_ctx->output_format) {
329 case AV_PIX_FMT_NV12:
330 case AV_PIX_FMT_P010:
331 break;
332 default:
333 av_log(avctx, AV_LOG_ERROR, "Invalid output format.\n");
334 return AVERROR(EINVAL);
335 }
336 } else {
337 vpp_ctx->output_format = AV_PIX_FMT_NV12;
338 av_log(avctx, AV_LOG_WARNING, "Output format not set, use default format NV12\n");
339 }
340
341#define STRING_OPTION(var_name, func_name, default_value) do { \
342 if (ctx->var_name ## _string) { \
343 int var = av_ ## func_name ## _from_name(ctx->var_name ## _string); \
344 if (var < 0) { \
345 av_log(avctx, AV_LOG_ERROR, "Invalid %s.\n", #var_name); \
346 return AVERROR(EINVAL); \
347 } \
348 ctx->var_name = var; \
349 } else { \
350 ctx->var_name = default_value; \
351 } \
352 } while (0)
353
354 STRING_OPTION(color_primaries, color_primaries, AVCOL_PRI_UNSPECIFIED);
355 STRING_OPTION(color_transfer, color_transfer, AVCOL_TRC_UNSPECIFIED);
356 STRING_OPTION(color_matrix, color_space, AVCOL_SPC_UNSPECIFIED);
357
358 return 0;
359}
360
361#define OFFSET(x) offsetof(HDRVAAPIContext, x)
362#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM)
363static const AVOption tonemap_vaapi_options[] = {
364 { "format", "Output pixel format set", OFFSET(output_format_string), AV_OPT_TYPE_STRING, .flags = FLAGS, "format" },
365 { "matrix", "Output color matrix coefficient set",
366 OFFSET(color_matrix_string), AV_OPT_TYPE_STRING,
367 { .str = NULL }, .flags = FLAGS, "matrix" },
368 { "m", "Output color matrix coefficient set",
369 OFFSET(color_matrix_string), AV_OPT_TYPE_STRING,
370 { .str = NULL }, .flags = FLAGS, "matrix" },
371 { "primaries", "Output color primaries set",
372 OFFSET(color_primaries_string), AV_OPT_TYPE_STRING,
373 { .str = NULL }, .flags = FLAGS, "primaries" },
374 { "p", "Output color primaries set",
375 OFFSET(color_primaries_string), AV_OPT_TYPE_STRING,
376 { .str = NULL }, .flags = FLAGS, "primaries" },
377 { "transfer", "Output color transfer characteristics set",
378 OFFSET(color_transfer_string), AV_OPT_TYPE_STRING,
379 { .str = NULL }, .flags = FLAGS, "transfer" },
380 { "t", "Output color transfer characteristics set",
381 OFFSET(color_transfer_string), AV_OPT_TYPE_STRING,
382 { .str = NULL }, .flags = FLAGS, "transfer" },
383 { NULL }
384};
385
386
387AVFILTER_DEFINE_CLASS(tonemap_vaapi);
388
389static const AVFilterPad tonemap_vaapi_inputs[] = {
390 {
391 .name = "default",
392 .type = AVMEDIA_TYPE_VIDEO,
393 .filter_frame = &tonemap_vaapi_filter_frame,
394 .config_props = &ff_vaapi_vpp_config_input,
395 },
396 { NULL }
397};
398
399static const AVFilterPad tonemap_vaapi_outputs[] = {
400 {
401 .name = "default",
402 .type = AVMEDIA_TYPE_VIDEO,
403 .config_props = &ff_vaapi_vpp_config_output,
404 },
405 { NULL }
406};
407
408AVFilter ff_vf_tonemap_vaapi = {
409 .name = "tonemap_vaapi",
410 .description = NULL_IF_CONFIG_SMALL("VAAPI VPP for tone-mapping"),
411 .priv_size = sizeof(HDRVAAPIContext),
412 .init = &tonemap_vaapi_init,
413 .uninit = &ff_vaapi_vpp_ctx_uninit,
414 .query_formats = &ff_vaapi_vpp_query_formats,
415 .inputs = tonemap_vaapi_inputs,
416 .outputs = tonemap_vaapi_outputs,
417 .priv_class = &tonemap_vaapi_class,
418 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
419};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t