FFmpeg
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 
30 typedef struct LCEVCContext {
32  int w, h;
33 } LCEVCContext;
34 
35 static LCEVC_ColorFormat map_format(int format)
36 {
37  switch (format) {
38  case AV_PIX_FMT_YUV420P:
39  return LCEVC_I420_8;
41  return LCEVC_I420_10_LE;
43  return LCEVC_I420_12_LE;
44  case AV_PIX_FMT_YUV422P:
45  return LCEVC_I422_8;
47  return LCEVC_I422_10_LE;
49  return LCEVC_I422_12_LE;
50  case AV_PIX_FMT_YUV444P:
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;
60  case AV_PIX_FMT_GRAY8:
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 
71 static inline LCEVC_ColorRange map_range(int range)
72 {
73  switch (range) {
74  case AVCOL_RANGE_MPEG:
75  return LCEVC_ColorRange_Limited;
76  case AVCOL_RANGE_JPEG:
77  return LCEVC_ColorRange_Full;
78  }
79 
80  return LCEVC_ColorRange_Unknown;
81 }
82 
83 static 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 
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 
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 
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;
227  av_frame_free(&out);
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 
290 static 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 
325 
327  if (ret < 0)
328  return ret;
329  if (!ret) {
330  int64_t pts;
332  if (!status)
333  ff_outlink_set_status(outlink, status, pts);
334  }
335  if (!status)
337  }
338 
339  if (in) {
340  if (in->width != inlink->w ||
341  in->height != inlink->h ||
342  in->sample_aspect_ratio.den != inlink->sample_aspect_ratio.den ||
343  in->sample_aspect_ratio.num != inlink->sample_aspect_ratio.num) {
344  inlink->dst->inputs[0]->w = in->width;
345  inlink->dst->inputs[0]->h = in->height;
346  inlink->dst->inputs[0]->sample_aspect_ratio.den = in->sample_aspect_ratio.den;
347  inlink->dst->inputs[0]->sample_aspect_ratio.num = in->sample_aspect_ratio.num;
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 
362  if (ret < 0) {
363  av_frame_free(&out);
364  return ret;
365  }
366 
367  flush_bases(ctx);
368 
369  return ret;
370 }
371 
372 static 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);
428  flush_bases(ctx);
429  LCEVC_DestroyDecoder(lcevc->decoder);
430 }
431 
432 static const AVFilterPad lcevc_outputs[] = {
433  {
434  .name = "default",
435  .type = AVMEDIA_TYPE_VIDEO,
436  .config_props = config_props,
437  },
438 };
439 
440 static const enum AVPixelFormat pix_fmts[] = {
447 };
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 };
ff_get_video_buffer
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
AVFrame::color_trc
enum AVColorTransferCharacteristic color_trc
Definition: frame.h:689
AVFrame::color_range
enum AVColorRange color_range
MPEG vs JPEG YUV range.
Definition: frame.h:685
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
config_props
static int config_props(AVFilterLink *outlink)
Definition: vf_lcevc.c:290
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
AVColorTransferCharacteristic
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition: pixfmt.h:666
out
static FILE * out
Definition: movenc.c:55
av_frame_get_side_data
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
Definition: frame.c:659
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1067
int64_t
long long int64_t
Definition: coverity.c:34
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_lcevc.c:423
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
AV_VIDEO_MAX_PLANES
#define AV_VIDEO_MAX_PLANES
Maximum number of planes in any pixel format.
Definition: pixfmt.h:40
AVFrame::color_primaries
enum AVColorPrimaries color_primaries
Definition: frame.h:687
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:64
AVFrame::colorspace
enum AVColorSpace colorspace
YUV colorspace type.
Definition: frame.h:696
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:434
AVFrame::pts
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:536
AVFrame::width
int width
Definition: frame.h:506
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:777
filters.h
data
const char data[16]
Definition: mxf.c:149
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:539
base
uint8_t base
Definition: vp3data.h:128
AVColorPrimaries
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:636
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:220
map_format
static LCEVC_ColorFormat map_format(int format)
Definition: vf_lcevc.c:35
video.h
AV_PIX_FMT_GRAY10LE
@ AV_PIX_FMT_GRAY10LE
Y , 10bpp, little-endian.
Definition: pixfmt.h:321
lcevc_outputs
static const AVFilterPad lcevc_outputs[]
Definition: vf_lcevc.c:432
dummy
static int dummy
Definition: ffplay.c:3751
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:455
LCEVCContext::h
int h
Definition: vf_lcevc.c:32
ff_inlink_consume_frame
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:1515
AV_PIX_FMT_YUV420P12LE
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:268
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: filters.h:244
pts
static int64_t pts
Definition: transcode_aac.c:644
AVRational::num
int num
Numerator.
Definition: rational.h:59
AV_PIX_FMT_YUV420P10LE
@ AV_PIX_FMT_YUV420P10LE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:156
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:40
AV_PIX_FMT_YUV444P12LE
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:276
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:542
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
AVFrameSideData::size
size_t size
Definition: frame.h:292
av_cold
#define av_cold
Definition: attributes.h:111
ff_video_default_filterpad
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
FFFilter
Definition: filters.h:267
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:265
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_lcevc.c:385
ff_outlink_set_status
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
info
MIPS optimizations info
Definition: mips.txt:2
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:231
ctx
static AVFormatContext * ctx
Definition: movenc.c:49
receive_frame
static int receive_frame(AVFilterLink *inlink, AVFrame *out)
Definition: vf_lcevc.c:269
AVFrame::crop_right
size_t crop_right
Definition: frame.h:760
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
alloc_enhanced_frame
static int alloc_enhanced_frame(AVFilterLink *inlink, const AVFrame *out, LCEVC_PictureHandle *picture)
Definition: vf_lcevc.c:184
generate_output
static int generate_output(AVFilterLink *inlink, AVFrame *out)
Definition: vf_lcevc.c:212
AV_PIX_FMT_YUV444P10LE
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:162
activate
static int activate(AVFilterContext *ctx)
Definition: vf_lcevc.c:316
NULL
#define NULL
Definition: coverity.c:32
av_frame_copy_props
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:599
format
New swscale design to change SwsGraph is what coordinates multiple passes These can include cascaded scaling error diffusion and so on Or we could have separate passes for the vertical and horizontal scaling In between each SwsPass lies a fully allocated image buffer Graph passes may have different levels of e g we can have a single threaded error diffusion pass following a multi threaded scaling pass SwsGraph is internally recreated whenever the image format
Definition: swscale-v2.txt:14
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_lcevc.c:440
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
LCEVCContext::w
int w
Definition: vf_lcevc.c:32
map_range
static LCEVC_ColorRange map_range(int range)
Definition: vf_lcevc.c:71
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:540
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
ff_inlink_acknowledge_status
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:1462
AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_UNSPECIFIED
Definition: pixfmt.h:743
AVFrame::crop_bottom
size_t crop_bottom
Definition: frame.h:758
AVFrame::crop_left
size_t crop_left
Definition: frame.h:759
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
height
#define height
Definition: dsp.h:89
AV_PIX_FMT_YUV422P10LE
@ AV_PIX_FMT_YUV422P10LE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:158
i
#define i(width, name, range_min, range_max)
Definition: cbs_h264.c:63
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:544
AV_FRAME_DATA_LCEVC
@ AV_FRAME_DATA_LCEVC
Raw LCEVC payload data, as a uint8_t array, with NAL emulation bytes intact.
Definition: frame.h:236
size
int size
Definition: twinvq_data.h:10344
LCEVC_DecoderHandle
uintptr_t LCEVC_DecoderHandle
Definition: lcevcdec.h:28
AV_PIX_FMT_GRAY12LE
@ AV_PIX_FMT_GRAY12LE
Y , 12bpp, little-endian.
Definition: pixfmt.h:319
alloc_base_frame
static int alloc_base_frame(AVFilterLink *inlink, const AVFrame *in, LCEVC_PictureHandle *picture)
Definition: vf_lcevc.c:95
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:546
AVFrameSideData::data
uint8_t * data
Definition: frame.h:291
AVFrame::format
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition: frame.h:521
range
enum AVColorRange range
Definition: mediacodec_wrapper.c:2594
av_frame_remove_side_data
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
AVERROR_EXTERNAL
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition: error.h:59
planes
static const struct @585 planes[]
FF_FILTER_FORWARD_WANTED
FF_FILTER_FORWARD_WANTED(outlink, inlink)
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:221
LCEVCContext
Definition: vf_lcevc.c:30
log_callback
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
internal.h
AVColorSpace
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:700
LCEVCContext::decoder
LCEVC_DecoderHandle decoder
Definition: vf_lcevc.c:31
AV_PIX_FMT_NV21
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
Definition: pixfmt.h:97
AVFilterPad::name
const char * name
Pad name.
Definition: filters.h:46
map_av_range
static enum AVColorRange map_av_range(int range)
Definition: vf_lcevc.c:83
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:760
ret
ret
Definition: filter_design.txt:187
AV_PIX_FMT_NV12
@ 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
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:264
AVFrame::sample_aspect_ratio
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
Definition: frame.h:531
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:543
flush_bases
static void flush_bases(AVFilterContext *ctx)
Definition: vf_lcevc.c:303
AVFrame::height
int height
Definition: frame.h:506
status
ov_status_e status
Definition: dnn_backend_openvino.c:100
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
ff_vf_lcevc
const FFFilter ff_vf_lcevc
Definition: vf_lcevc.c:449
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
AVFilterContext
An instance of a filter.
Definition: avfilter.h:274
FF_FILTER_FORWARD_STATUS_BACK
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
Definition: filters.h:639
desc
const char * desc
Definition: libsvtav1.c:82
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
FFFilter::p
AVFilter p
The public AVFilter.
Definition: filters.h:271
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
AVFrameSideData
Structure to hold side data for an AVFrame.
Definition: frame.h:289
AVFrame::crop_top
size_t crop_top
Definition: frame.h:757
int32_t
int32_t
Definition: audioconvert.c:56
AVERROR_BUG
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Definition: error.h:52
AVFrame::linesize
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:479
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
width
#define width
Definition: dsp.h:89
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:742
AV_PIX_FMT_YUV422P12LE
@ AV_PIX_FMT_YUV422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:272
send_frame
static int send_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_lcevc.c:144