FFmpeg
Loading...
Searching...
No Matches
vf_lcevc.c
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * Copyright (c) 2024 James Almer <jamrial@gmail.com>
5 *
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.
10 *
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.
15 *
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
19 */
20
21#include <stdint.h>
22
23#include <LCEVC/lcevc_dec.h>
24
25#include "libavutil/internal.h"
26#include "libavutil/opt.h"
27#include "filters.h"
28#include "video.h"
29
34
35static LCEVC_ColorFormat map_format(int format)
36{
37 switch (format) {
39 return LCEVC_I420_8;
41 return LCEVC_I420_10_LE;
43 return LCEVC_I420_12_LE;
45 return LCEVC_I422_8;
47 return LCEVC_I422_10_LE;
49 return LCEVC_I422_12_LE;
51 return LCEVC_I444_8;
53 return LCEVC_I444_10_LE;
55 return LCEVC_I444_12_LE;
56 case AV_PIX_FMT_NV12:
57 return LCEVC_NV12_8;
58 case AV_PIX_FMT_NV21:
59 return LCEVC_NV21_8;
61 return LCEVC_GRAY_8;
63 return LCEVC_GRAY_10_LE;
65 return LCEVC_GRAY_12_LE;
66 }
67
68 return LCEVC_ColorFormat_Unknown;
69}
70
71static inline LCEVC_ColorRange map_range(int range)
72{
73 switch (range) {
75 return LCEVC_ColorRange_Limited;
77 return LCEVC_ColorRange_Full;
78 }
79
80 return LCEVC_ColorRange_Unknown;
81}
82
83static inline enum AVColorRange map_av_range(int range)
84{
85 switch (range) {
86 case LCEVC_ColorRange_Limited:
87 return AVCOL_RANGE_MPEG;
88 case LCEVC_ColorRange_Full:
89 return AVCOL_RANGE_JPEG;
90 }
91
93}
94
95static int alloc_base_frame(AVFilterLink *inlink, const AVFrame *in,
96 LCEVC_PictureHandle *picture)
97{
98 AVFilterContext *ctx = inlink->dst;
99 LCEVCContext *lcevc = ctx->priv;
100 LCEVC_PictureDesc desc;
101 LCEVC_PicturePlaneDesc planes[AV_VIDEO_MAX_PLANES] = { 0 };
102 LCEVC_ColorFormat fmt = map_format(in->format);
103 int width = in->width - in->crop_left - in->crop_right;
104 int height = in->height - in->crop_top - in->crop_bottom;
105 LCEVC_ReturnCode res;
106
107 res = LCEVC_DefaultPictureDesc(&desc, fmt, width, height);
108 if (res != LCEVC_Success) {
109 av_log(ctx, AV_LOG_ERROR, "LCEVC_DefaultPictureDesc failed\n");
110 return AVERROR_EXTERNAL;
111 }
112
113 for (int i = 0; i < AV_VIDEO_MAX_PLANES; i++) {
114 planes[i].firstSample = in->data[i];
115 planes[i].rowByteStride = in->linesize[i];
116 }
117
118 desc.cropTop = in->crop_top;
119 desc.cropBottom = in->crop_bottom;
120 desc.cropLeft = in->crop_left;
121 desc.cropRight = in->crop_right;
122 desc.sampleAspectRatioNum = in->sample_aspect_ratio.num;
123 desc.sampleAspectRatioDen = in->sample_aspect_ratio.den;
124 desc.colorRange = map_range(in->color_range);
125 desc.colorPrimaries = (LCEVC_ColorPrimaries)in->color_primaries;
126 desc.matrixCoefficients = (LCEVC_MatrixCoefficients)in->colorspace;
127 desc.transferCharacteristics = (LCEVC_TransferCharacteristics)in->color_trc;
128 av_log(ctx, AV_LOG_DEBUG, "in PTS %"PRId64", %dx%d, "
129 "%zu/%zu/%zu/%zu, "
130 "SAR %d:%d\n",
131 in->pts, in->width, in->height,
132 in->crop_top, in->crop_bottom, in->crop_left, in->crop_right,
134
135 res = LCEVC_AllocPictureExternal(lcevc->decoder, &desc, NULL, planes, picture);
136 if (res != LCEVC_Success) {
137 av_log(ctx, AV_LOG_ERROR, "LCEVC_AllocPictureExternal to allocate a buffer for a base frame\n");
138 return AVERROR_EXTERNAL;
139 }
140
141 return 0;
142}
143
144static int send_frame(AVFilterLink *inlink, AVFrame *in)
145{
146 AVFilterContext *ctx = inlink->dst;
147 LCEVCContext *lcevc = ctx->priv;
148 LCEVC_PictureHandle picture;
150 LCEVC_ReturnCode res;
151 int ret;
152
153 ret = alloc_base_frame(inlink, in, &picture);
154 if (ret < 0)
155 return ret;
156
157 if (sd) {
158 res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, in->pts, sd->data, sd->size);
159 if (res == LCEVC_Again)
160 return AVERROR(EAGAIN);
161 else if (res != LCEVC_Success) {
162 av_log(ctx, AV_LOG_ERROR, "LCEVC_SendDecoderEnhancementData failed\n");
163 return AVERROR_EXTERNAL;
164 }
165 }
166
167 res = LCEVC_SetPictureUserData(lcevc->decoder, picture, in);
168 if (res != LCEVC_Success) {
169 av_log(ctx, AV_LOG_ERROR, "LCEVC_SetPictureUserData failed\n");
170 LCEVC_FreePicture(lcevc->decoder, picture);
171 return AVERROR_EXTERNAL;
172 }
173
174 res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, picture, -1, in);
175 if (res != LCEVC_Success) {
176 av_log(ctx, AV_LOG_ERROR, "LCEVC_SendDecoderBase failed\n");
177 LCEVC_FreePicture(lcevc->decoder, picture);
178 return AVERROR_EXTERNAL;
179 }
180
181 return 0;
182}
183
184static int alloc_enhanced_frame(AVFilterLink *inlink, const AVFrame *out,
185 LCEVC_PictureHandle *picture)
186{
187 AVFilterContext *ctx = inlink->dst;
188 LCEVCContext *lcevc = ctx->priv;
189 LCEVC_PictureDesc desc;
190 LCEVC_PicturePlaneDesc planes[AV_VIDEO_MAX_PLANES] = { 0 };
191 LCEVC_ColorFormat fmt = map_format(out->format);
192 LCEVC_ReturnCode res;
193
194 res = LCEVC_DefaultPictureDesc(&desc, fmt, out->width, out->height);
195 if (res != LCEVC_Success)
196 return AVERROR_EXTERNAL;
197
198 for (int i = 0; i < AV_VIDEO_MAX_PLANES; i++) {
199 planes[i].firstSample = out->data[i];
200 planes[i].rowByteStride = out->linesize[i];
201 }
202
203 res = LCEVC_AllocPictureExternal(lcevc->decoder, &desc, NULL, planes, picture);
204 if (res != LCEVC_Success) {
205 av_log(ctx, AV_LOG_ERROR, "LCEVC_AllocPictureExternal to allocate a buffer for an enhanced frame\n");
206 return AVERROR_EXTERNAL;
207 }
208
209 return 0;
210}
211
213{
214 AVFilterContext *ctx = inlink->dst;
215 AVFilterLink *outlink = ctx->outputs[0];
216 LCEVCContext *lcevc = ctx->priv;
217 LCEVC_PictureDesc desc;
218 LCEVC_DecodeInformation info;
219 LCEVC_PictureHandle picture;
220 LCEVC_ReturnCode res;
221
222 res = LCEVC_ReceiveDecoderPicture(lcevc->decoder, &picture, &info);
223 if (res == LCEVC_Again) {
224 int64_t pts;
225 int status;
226 if (ff_inlink_acknowledge_status(inlink, &status, &pts)) {
228 ff_outlink_set_status(outlink, status, pts);
229 return 0;
230 }
231 // this shouldn't be reachable, but instead of asserting, just error out
232 return AVERROR_BUG;
233 } else if (res != LCEVC_Success) {
234 av_log(ctx, AV_LOG_ERROR, "LCEVC_ReceiveDecoderPicture failed\n");
235 return AVERROR_EXTERNAL;
236 }
237
238 av_frame_copy_props(out, (AVFrame *)info.baseUserData);
240
241 res = LCEVC_GetPictureDesc(lcevc->decoder, picture, &desc);
242 LCEVC_FreePicture(lcevc->decoder, picture);
243
244 out->crop_top = desc.cropTop;
245 out->crop_bottom = desc.cropBottom;
246 out->crop_left = desc.cropLeft;
247 out->crop_right = desc.cropRight;
248 out->sample_aspect_ratio.num = outlink->sample_aspect_ratio.num = desc.sampleAspectRatioNum;
249 out->sample_aspect_ratio.den = outlink->sample_aspect_ratio.den = desc.sampleAspectRatioDen;
250 out->color_range = map_range(desc.colorRange);
251 out->color_primaries = (enum AVColorPrimaries)desc.colorPrimaries;
252 out->colorspace = (enum AVColorSpace)desc.matrixCoefficients;
253 out->color_trc = (enum AVColorTransferCharacteristic)desc.transferCharacteristics;
254 out->width = outlink->w = desc.width + out->crop_left + out->crop_right;
255 out->height = outlink->h = desc.height + out->crop_top + out->crop_bottom;
256
257 av_log(ctx, AV_LOG_DEBUG, "out PTS %"PRId64", %dx%d, "
258 "%zu/%zu/%zu/%zu, "
259 "SAR %d:%d, "
260 "hasEnhancement %d, enhanced %d\n",
261 out->pts, out->width, out->height,
262 out->crop_top, out->crop_bottom, out->crop_left, out->crop_right,
263 out->sample_aspect_ratio.num, out->sample_aspect_ratio.den,
264 info.hasEnhancement, info.enhanced);
265
266 return ff_filter_frame(outlink, out);
267}
268
270{
271 AVFilterContext *ctx = inlink->dst;
272 LCEVCContext *lcevc = ctx->priv;
273 LCEVC_PictureHandle picture;
274 LCEVC_ReturnCode res;
275 int ret;
276
277 ret = alloc_enhanced_frame(inlink, out, &picture);
278 if (ret < 0)
279 return ret;
280
281 res = LCEVC_SendDecoderPicture(lcevc->decoder, picture);
282 if (res != LCEVC_Success) {
283 av_log(ctx, AV_LOG_ERROR, "LCEVC_SendDecoderPicture failed\n");
284 return AVERROR_EXTERNAL;
285 }
286
287 return generate_output(inlink, out);
288}
289
290static int config_props(AVFilterLink *outlink)
291{
292 AVFilterContext *ctx = outlink->src;
293 AVFilterLink *inlink = ctx->inputs[0];
294 LCEVCContext *lcevc = ctx->priv;
295
296 outlink->w = lcevc->w = inlink->w * 2;
297 outlink->h = lcevc->h = inlink->h * 2;
298 outlink->sample_aspect_ratio = (AVRational) { 0, 1 };
299
300 return 0;
301}
302
304{
305 LCEVCContext *lcevc = ctx->priv;
306 LCEVC_PictureHandle picture;
307
308 while (LCEVC_ReceiveDecoderBase(lcevc->decoder, &picture) == LCEVC_Success) {
309 AVFrame *base = NULL;
310 LCEVC_GetPictureUserData(lcevc->decoder, picture, (void **)&base);
311 LCEVC_FreePicture(lcevc->decoder, picture);
313 }
314}
315
317{
318 LCEVCContext *lcevc = ctx->priv;
319 AVFilterLink *inlink = ctx->inputs[0];
320 AVFilterLink *outlink = ctx->outputs[0];
321 AVFrame *in, *out;
322 int status, ret;
323
324 FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
325
326 ret = ff_inlink_consume_frame(inlink, &in);
327 if (ret < 0)
328 return ret;
329 if (!ret) {
330 int64_t pts;
331 if (ff_inlink_acknowledge_status(inlink, &status, &pts)) {
332 if (!status)
333 ff_outlink_set_status(outlink, status, pts);
334 }
335 if (!status)
336 FF_FILTER_FORWARD_WANTED(outlink, inlink);
337 }
338
339 if (in) {
340 if (in->width != inlink->w ||
341 in->height != inlink->h ||
344 inlink->dst->inputs[0]->w = in->width;
345 inlink->dst->inputs[0]->h = in->height;
348
349 config_props(outlink);
350 }
351
352 ret = send_frame(inlink, in);
353 if (ret < 0)
354 return ret;
355 }
356
357 out = ff_get_video_buffer(outlink, lcevc->w, lcevc->h);
358 if (!out)
359 return AVERROR(ENOMEM);
360
361 ret = receive_frame(inlink, out);
362 if (ret < 0) {
364 return ret;
365 }
366
368
369 return ret;
370}
371
372static void log_callback(LCEVC_DecoderHandle dec, LCEVC_Event event,
373 LCEVC_PictureHandle pic, const LCEVC_DecodeInformation *info,
374 const uint8_t *data, uint32_t size, void *logctx)
375{
376 if (event != LCEVC_Log) // shouldn't happen
377 return;
378
379 if (strlen(data) != size) // sanitize input
380 return;
381
382 av_log(logctx, AV_LOG_INFO, "LCEVC Log: %s\n", data);
383}
384
386{
387 LCEVCContext *lcevc = ctx->priv;
388 LCEVC_AccelContextHandle dummy = { 0 };
389 const int32_t event = LCEVC_Log;
390 LCEVC_ReturnCode res;
391
392 res = LCEVC_CreateDecoder(&lcevc->decoder, dummy);
393 if (res != LCEVC_Success) {
394 av_log(ctx, AV_LOG_ERROR, "LCEVC_CreateDecoder failed\n");
395 return AVERROR_EXTERNAL;
396 }
397
398 res = LCEVC_ConfigureDecoderInt(lcevc->decoder, "log_level", 4);
399 if (res != LCEVC_Success) {
400 av_log(ctx, AV_LOG_ERROR, "LCEVC_ConfigureDecoderInt failed to set \"log_level\"\n");
401 return AVERROR_EXTERNAL;
402 }
403 res = LCEVC_ConfigureDecoderIntArray(lcevc->decoder, "events", 1, &event);
404 if (res != LCEVC_Success) {
405 av_log(ctx, AV_LOG_ERROR, "LCEVC_ConfigureDecoderIntArray failed to set \"events\"\n");
406 return AVERROR_EXTERNAL;
407 }
408 res = LCEVC_SetDecoderEventCallback(lcevc->decoder, log_callback, ctx);
409 if (res != LCEVC_Success) {
410 av_log(ctx, AV_LOG_ERROR, "LCEVC_SetDecoderEventCallback failed\n");
411 return AVERROR_EXTERNAL;
412 }
413
414 res = LCEVC_InitializeDecoder(lcevc->decoder);
415 if (res != LCEVC_Success) {
416 av_log(ctx, AV_LOG_ERROR, "LCEVC_InitializeDecoder failed\n");
417 return AVERROR_EXTERNAL;
418 }
419
420 return 0;
421}
422
424{
425 LCEVCContext *lcevc = ctx->priv;
426
427 LCEVC_FlushDecoder(lcevc->decoder);
429 LCEVC_DestroyDecoder(lcevc->decoder);
430}
431
432static const AVFilterPad lcevc_outputs[] = {
433 {
434 .name = "default",
435 .type = AVMEDIA_TYPE_VIDEO,
436 .config_props = config_props,
437 },
438};
439
448
450 .p.name = "lcevc",
451 .p.description = NULL_IF_CONFIG_SMALL("LCEVC"),
452 .activate = activate,
456 .priv_size = sizeof(LCEVCContext),
457 .init = init,
458 .uninit = uninit,
459};
static const char *const format[]
Definition af_aiir.c:444
const FFFilter ff_vf_lcevc
Definition vf_lcevc.c:449
int32_t
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
Definition avfilter.c:1467
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
Definition avfilter.c:1520
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static int dummy
Definition ffplay.c:3754
static void log_callback(void *ptr, int level, const char *fmt, va_list vl)
Definition ffprobe.c:381
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition error.h:59
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Definition error.h:52
#define AVERROR(e)
Definition error.h:45
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
Definition frame.c:659
void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
Remove and free all side data instances of the given type.
Definition frame.c:725
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition frame.c:599
@ AV_FRAME_DATA_LCEVC
Raw LCEVC payload data, as a uint8_t array, with NAL emulation bytes intact.
Definition frame.h:236
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition log.h:231
#define AV_LOG_INFO
Standard information.
Definition log.h:221
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
uintptr_t LCEVC_DecoderHandle
Definition lcevcdec.h:31
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FF_FILTER_FORWARD_WANTED(outlink, inlink)
Forward the frame_wanted_out flag from an output link to an input link.
Definition filters.h:694
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:244
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
Definition filters.h:629
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
Definition filters.h:639
#define av_cold
Definition attributes.h:117
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
const char * desc
Definition libsvtav1.c:83
static const struct @257111027162314367033347246032313251342043035002 planes[]
enum AVColorRange range
const char data[16]
Definition mxf.c:149
AVOptions.
#define AV_PIX_FMT_YUV444P12
Definition pixfmt.h:552
#define AV_PIX_FMT_YUV420P10
Definition pixfmt.h:545
AVColorRange
Visual content value range.
Definition pixfmt.h:748
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition pixfmt.h:766
@ AVCOL_RANGE_UNSPECIFIED
Definition pixfmt.h:749
@ AVCOL_RANGE_JPEG
Full range content.
Definition pixfmt.h:783
#define AV_PIX_FMT_YUV420P12
Definition pixfmt.h:549
#define AV_PIX_FMT_YUV422P12
Definition pixfmt.h:550
#define AV_VIDEO_MAX_PLANES
Maximum number of planes in any pixel format.
Definition pixfmt.h:40
#define AV_PIX_FMT_YUV422P10
Definition pixfmt.h:546
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ 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...
Definition pixfmt.h:96
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_GRAY10LE
Y , 10bpp, little-endian.
Definition pixfmt.h:321
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
Definition pixfmt.h:97
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_GRAY12LE
Y , 12bpp, little-endian.
Definition pixfmt.h:319
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_YUV420P10LE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition pixfmt.h:156
@ AV_PIX_FMT_YUV422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition pixfmt.h:272
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition pixfmt.h:268
@ AV_PIX_FMT_YUV422P10LE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition pixfmt.h:158
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition pixfmt.h:162
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition pixfmt.h:276
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition pixfmt.h:642
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition pixfmt.h:672
#define AV_PIX_FMT_YUV444P10
Definition pixfmt.h:548
AVColorSpace
YUV colorspace type.
Definition pixfmt.h:706
static int config_props(AVBitStreamFilterLink *link)
Definition source.c:181
An instance of a filter.
Definition avfilter.h:273
AVFilterLink ** inputs
array of pointers to input links
Definition avfilter.h:281
A filter pad used for either input or output.
Definition filters.h:40
Structure to hold side data for an AVFrame.
Definition frame.h:327
size_t size
Definition frame.h:330
uint8_t * data
Definition frame.h:329
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition frame.h:574
size_t crop_right
Definition frame.h:798
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:493
int width
Definition frame.h:544
int height
Definition frame.h:544
enum AVColorPrimaries color_primaries
Definition frame.h:725
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
Definition frame.h:569
size_t crop_top
Definition frame.h:795
enum AVColorRange color_range
MPEG vs JPEG YUV range.
Definition frame.h:723
enum AVColorSpace colorspace
YUV colorspace type.
Definition frame.h:734
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition frame.h:517
size_t crop_left
Definition frame.h:797
enum AVColorTransferCharacteristic color_trc
Definition frame.h:727
size_t crop_bottom
Definition frame.h:796
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition frame.h:559
Rational number (pair of numerator and denominator).
Definition rational.h:58
int num
Numerator.
Definition rational.h:59
int den
Denominator.
Definition rational.h:60
LCEVC_DecoderHandle decoder
Definition vf_lcevc.c:31
#define av_log(a,...)
static FILE * out
Definition movenc.c:55
static AVFormatContext * ctx
Definition movenc.c:49
#define height
Definition dsp.h:89
#define width
Definition dsp.h:89
static int64_t pts
int size
static LCEVC_ColorFormat map_format(int format)
Definition vf_lcevc.c:35
static int alloc_base_frame(AVFilterLink *inlink, const AVFrame *in, LCEVC_PictureHandle *picture)
Definition vf_lcevc.c:95
static LCEVC_ColorRange map_range(int range)
Definition vf_lcevc.c:71
static int config_props(AVFilterLink *outlink)
Definition vf_lcevc.c:290
static int alloc_enhanced_frame(AVFilterLink *inlink, const AVFrame *out, LCEVC_PictureHandle *picture)
Definition vf_lcevc.c:184
static enum AVColorRange map_av_range(int range)
Definition vf_lcevc.c:83
static int activate(AVFilterContext *ctx)
Definition vf_lcevc.c:316
static av_cold void uninit(AVFilterContext *ctx)
Definition vf_lcevc.c:423
static int generate_output(AVFilterLink *inlink, AVFrame *out)
Definition vf_lcevc.c:212
static void log_callback(LCEVC_DecoderHandle dec, LCEVC_Event event, LCEVC_PictureHandle pic, const LCEVC_DecodeInformation *info, const uint8_t *data, uint32_t size, void *logctx)
Definition vf_lcevc.c:372
static const AVFilterPad lcevc_outputs[]
Definition vf_lcevc.c:432
static int receive_frame(AVFilterLink *inlink, AVFrame *out)
Definition vf_lcevc.c:269
static int send_frame(AVFilterLink *inlink, AVFrame *in)
Definition vf_lcevc.c:144
static void flush_bases(AVFilterContext *ctx)
Definition vf_lcevc.c:303
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition video.c:37
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition video.c:89
uint8_t base
Definition vp3data.h:128