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;
42  case AV_PIX_FMT_NV12:
43  return LCEVC_NV12_8;
44  case AV_PIX_FMT_NV21:
45  return LCEVC_NV21_8;
46  case AV_PIX_FMT_GRAY8:
47  return LCEVC_GRAY_8;
49  return LCEVC_GRAY_10_LE;
50  }
51 
52  return LCEVC_ColorFormat_Unknown;
53 }
54 
55 static inline LCEVC_ColorRange map_range(int range)
56 {
57  switch (range) {
58  case AVCOL_RANGE_MPEG:
59  return LCEVC_ColorRange_Limited;
60  case AVCOL_RANGE_JPEG:
61  return LCEVC_ColorRange_Full;
62  }
63 
64  return LCEVC_ColorRange_Unknown;
65 }
66 
67 static inline enum AVColorRange map_av_range(int range)
68 {
69  switch (range) {
70  case LCEVC_ColorRange_Limited:
71  return AVCOL_RANGE_MPEG;
72  case LCEVC_ColorRange_Full:
73  return AVCOL_RANGE_JPEG;
74  }
75 
77 }
78 
80  LCEVC_PictureHandle *picture)
81 {
82  AVFilterContext *ctx = inlink->dst;
83  LCEVCContext *lcevc = ctx->priv;
84  LCEVC_PictureDesc desc;
85  LCEVC_PicturePlaneDesc planes[AV_VIDEO_MAX_PLANES] = { 0 };
86  LCEVC_ColorFormat fmt = map_format(in->format);
87  int width = in->width - in->crop_left - in->crop_right;
88  int height = in->height - in->crop_top - in->crop_bottom;
89  LCEVC_ReturnCode res;
90 
91  res = LCEVC_DefaultPictureDesc(&desc, fmt, width, height);
92  if (res != LCEVC_Success) {
93  av_log(ctx, AV_LOG_ERROR, "LCEVC_DefaultPictureDesc failed\n");
94  return AVERROR_EXTERNAL;
95  }
96 
97  for (int i = 0; i < AV_VIDEO_MAX_PLANES; i++) {
98  planes[i].firstSample = in->data[i];
99  planes[i].rowByteStride = in->linesize[i];
100  }
101 
102  desc.cropTop = in->crop_top;
103  desc.cropBottom = in->crop_bottom;
104  desc.cropLeft = in->crop_left;
105  desc.cropRight = in->crop_right;
106  desc.sampleAspectRatioNum = in->sample_aspect_ratio.num;
107  desc.sampleAspectRatioDen = in->sample_aspect_ratio.den;
108  desc.colorRange = map_range(in->color_range);
109  desc.colorPrimaries = (LCEVC_ColorPrimaries)in->color_primaries;
110  desc.matrixCoefficients = (LCEVC_MatrixCoefficients)in->colorspace;
111  desc.transferCharacteristics = (LCEVC_TransferCharacteristics)in->color_trc;
112  av_log(ctx, AV_LOG_DEBUG, "in PTS %"PRId64", %dx%d, "
113  "%zu/%zu/%zu/%zu, "
114  "SAR %d:%d\n",
115  in->pts, in->width, in->height,
116  in->crop_top, in->crop_bottom, in->crop_left, in->crop_right,
118 
119  res = LCEVC_AllocPictureExternal(lcevc->decoder, &desc, NULL, planes, picture);
120  if (res != LCEVC_Success) {
121  av_log(ctx, AV_LOG_ERROR, "LCEVC_AllocPictureExternal to allocate a buffer for a base frame\n");
122  return AVERROR_EXTERNAL;
123  }
124 
125  return 0;
126 }
127 
129 {
130  AVFilterContext *ctx = inlink->dst;
131  LCEVCContext *lcevc = ctx->priv;
132  LCEVC_PictureHandle picture;
134  LCEVC_ReturnCode res;
135  int ret;
136 
137  ret = alloc_base_frame(inlink, in, &picture);
138  if (ret < 0)
139  return ret;
140 
141  if (sd) {
142  res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, in->pts, sd->data, sd->size);
143  if (res == LCEVC_Again)
144  return AVERROR(EAGAIN);
145  else if (res != LCEVC_Success) {
146  av_log(ctx, AV_LOG_ERROR, "LCEVC_SendDecoderEnhancementData failed\n");
147  return AVERROR_EXTERNAL;
148  }
149  }
150 
151  res = LCEVC_SetPictureUserData(lcevc->decoder, picture, in);
152  if (res != LCEVC_Success) {
153  av_log(ctx, AV_LOG_ERROR, "LCEVC_SetPictureUserData failed\n");
154  LCEVC_FreePicture(lcevc->decoder, picture);
155  return AVERROR_EXTERNAL;
156  }
157 
158  res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, picture, -1, in);
159  if (res != LCEVC_Success) {
160  av_log(ctx, AV_LOG_ERROR, "LCEVC_SendDecoderBase failed\n");
161  LCEVC_FreePicture(lcevc->decoder, picture);
162  return AVERROR_EXTERNAL;
163  }
164 
165  return 0;
166 }
167 
169  LCEVC_PictureHandle *picture)
170 {
171  AVFilterContext *ctx = inlink->dst;
172  LCEVCContext *lcevc = ctx->priv;
173  LCEVC_PictureDesc desc;
174  LCEVC_PicturePlaneDesc planes[AV_VIDEO_MAX_PLANES] = { 0 };
175  LCEVC_ColorFormat fmt = map_format(out->format);
176  LCEVC_ReturnCode res;
177 
178  res = LCEVC_DefaultPictureDesc(&desc, fmt, out->width, out->height);
179  if (res != LCEVC_Success)
180  return AVERROR_EXTERNAL;
181 
182  for (int i = 0; i < AV_VIDEO_MAX_PLANES; i++) {
183  planes[i].firstSample = out->data[i];
184  planes[i].rowByteStride = out->linesize[i];
185  }
186 
187  res = LCEVC_AllocPictureExternal(lcevc->decoder, &desc, NULL, planes, picture);
188  if (res != LCEVC_Success) {
189  av_log(ctx, AV_LOG_ERROR, "LCEVC_AllocPictureExternal to allocate a buffer for an enhanced frame\n");
190  return AVERROR_EXTERNAL;
191  }
192 
193  return 0;
194 }
195 
197 {
198  AVFilterContext *ctx = inlink->dst;
199  AVFilterLink *outlink = ctx->outputs[0];
200  LCEVCContext *lcevc = ctx->priv;
201  LCEVC_PictureDesc desc;
202  LCEVC_DecodeInformation info;
203  LCEVC_PictureHandle picture;
204  LCEVC_ReturnCode res;
205 
206  res = LCEVC_ReceiveDecoderPicture(lcevc->decoder, &picture, &info);
207  if (res == LCEVC_Again) {
208  int64_t pts;
209  int status;
211  av_frame_free(&out);
212  ff_outlink_set_status(outlink, status, pts);
213  return 0;
214  }
215  // this shouldn't be reachable, but instead of asserting, just error out
216  return AVERROR_BUG;
217  } else if (res != LCEVC_Success) {
218  av_log(ctx, AV_LOG_ERROR, "LCEVC_ReceiveDecoderPicture failed\n");
219  return AVERROR_EXTERNAL;
220  }
221 
222  av_frame_copy_props(out, (AVFrame *)info.baseUserData);
224 
225  res = LCEVC_GetPictureDesc(lcevc->decoder, picture, &desc);
226  LCEVC_FreePicture(lcevc->decoder, picture);
227 
228  out->crop_top = desc.cropTop;
229  out->crop_bottom = desc.cropBottom;
230  out->crop_left = desc.cropLeft;
231  out->crop_right = desc.cropRight;
232  out->sample_aspect_ratio.num = outlink->sample_aspect_ratio.num = desc.sampleAspectRatioNum;
233  out->sample_aspect_ratio.den = outlink->sample_aspect_ratio.den = desc.sampleAspectRatioDen;
234  out->color_range = map_range(desc.colorRange);
235  out->color_primaries = (enum AVColorPrimaries)desc.colorPrimaries;
236  out->colorspace = (enum AVColorSpace)desc.matrixCoefficients;
237  out->color_trc = (enum AVColorTransferCharacteristic)desc.transferCharacteristics;
238  out->width = outlink->w = desc.width + out->crop_left + out->crop_right;
239  out->height = outlink->h = desc.height + out->crop_top + out->crop_bottom;
240 
241  av_log(ctx, AV_LOG_DEBUG, "out PTS %"PRId64", %dx%d, "
242  "%zu/%zu/%zu/%zu, "
243  "SAR %d:%d, "
244  "hasEnhancement %d, enhanced %d\n",
245  out->pts, out->width, out->height,
246  out->crop_top, out->crop_bottom, out->crop_left, out->crop_right,
247  out->sample_aspect_ratio.num, out->sample_aspect_ratio.den,
248  info.hasEnhancement, info.enhanced);
249 
250  return ff_filter_frame(outlink, out);
251 }
252 
254 {
255  AVFilterContext *ctx = inlink->dst;
256  LCEVCContext *lcevc = ctx->priv;
257  LCEVC_PictureHandle picture;
258  LCEVC_ReturnCode res;
259  int ret;
260 
261  ret = alloc_enhanced_frame(inlink, out, &picture);
262  if (ret < 0)
263  return ret;
264 
265  res = LCEVC_SendDecoderPicture(lcevc->decoder, picture);
266  if (res != LCEVC_Success) {
267  av_log(ctx, AV_LOG_ERROR, "LCEVC_SendDecoderPicture failed\n");
268  return AVERROR_EXTERNAL;
269  }
270 
271  return generate_output(inlink, out);
272 }
273 
274 static int config_props(AVFilterLink *outlink)
275 {
276  AVFilterContext *ctx = outlink->src;
277  AVFilterLink *inlink = ctx->inputs[0];
278  LCEVCContext *lcevc = ctx->priv;
279 
280  outlink->w = lcevc->w = inlink->w * 2 / FFMAX(inlink->sample_aspect_ratio.den, 1);
281  outlink->h = lcevc->h = inlink->h * 2 / FFMAX(inlink->sample_aspect_ratio.den, 1);
282  outlink->sample_aspect_ratio = (AVRational) { 0, 1 };
283 
284  return 0;
285 }
286 
288 {
289  LCEVCContext *lcevc = ctx->priv;
290  LCEVC_PictureHandle picture;
291 
292  while (LCEVC_ReceiveDecoderBase(lcevc->decoder, &picture) == LCEVC_Success) {
293  AVFrame *base = NULL;
294  LCEVC_GetPictureUserData(lcevc->decoder, picture, (void **)&base);
295  LCEVC_FreePicture(lcevc->decoder, picture);
297  }
298 }
299 
301 {
302  LCEVCContext *lcevc = ctx->priv;
303  AVFilterLink *inlink = ctx->inputs[0];
304  AVFilterLink *outlink = ctx->outputs[0];
305  AVFrame *in, *out;
306  int status, ret;
307 
309 
311  if (ret < 0)
312  return ret;
313  if (!ret) {
314  int64_t pts;
316  if (!status)
317  ff_outlink_set_status(outlink, status, pts);
318  }
319  if (!status)
321  }
322 
323  if (in) {
324  if (in->width != inlink->w ||
325  in->height != inlink->h ||
326  in->sample_aspect_ratio.den != inlink->sample_aspect_ratio.den ||
327  in->sample_aspect_ratio.num != inlink->sample_aspect_ratio.num) {
328  inlink->dst->inputs[0]->w = in->width;
329  inlink->dst->inputs[0]->h = in->height;
330  inlink->dst->inputs[0]->sample_aspect_ratio.den = in->sample_aspect_ratio.den;
331  inlink->dst->inputs[0]->sample_aspect_ratio.num = in->sample_aspect_ratio.num;
332 
333  config_props(outlink);
334  }
335 
336  ret = send_frame(inlink, in);
337  if (ret < 0)
338  return ret;
339  }
340 
341  out = ff_get_video_buffer(outlink, lcevc->w, lcevc->h);
342  if (!out)
343  return AVERROR(ENOMEM);
344 
346  if (ret < 0) {
347  av_frame_free(&out);
348  return ret;
349  }
350 
351  flush_bases(ctx);
352 
353  return ret;
354 }
355 
356 static void log_callback(LCEVC_DecoderHandle dec, LCEVC_Event event,
357  LCEVC_PictureHandle pic, const LCEVC_DecodeInformation *info,
358  const uint8_t *data, uint32_t size, void *logctx)
359 {
360  if (event != LCEVC_Log) // shouldn't happen
361  return;
362 
363  if (strlen(data) != size) // sanitize input
364  return;
365 
366  av_log(logctx, AV_LOG_INFO, "LCEVC Log: %s\n", data);
367 }
368 
370 {
371  LCEVCContext *lcevc = ctx->priv;
372  LCEVC_AccelContextHandle dummy = { 0 };
373  const int32_t event = LCEVC_Log;
374  LCEVC_ReturnCode res;
375 
376  res = LCEVC_CreateDecoder(&lcevc->decoder, dummy);
377  if (res != LCEVC_Success) {
378  av_log(ctx, AV_LOG_ERROR, "LCEVC_CreateDecoder failed\n");
379  return AVERROR_EXTERNAL;
380  }
381 
382  res = LCEVC_ConfigureDecoderInt(lcevc->decoder, "log_level", 4);
383  if (res != LCEVC_Success) {
384  av_log(ctx, AV_LOG_ERROR, "LCEVC_ConfigureDecoderInt failed to set \"log_level\"\n");
385  return AVERROR_EXTERNAL;
386  }
387  res = LCEVC_ConfigureDecoderIntArray(lcevc->decoder, "events", 1, &event);
388  if (res != LCEVC_Success) {
389  av_log(ctx, AV_LOG_ERROR, "LCEVC_ConfigureDecoderIntArray failed to set \"events\"\n");
390  return AVERROR_EXTERNAL;
391  }
392  res = LCEVC_SetDecoderEventCallback(lcevc->decoder, log_callback, ctx);
393  if (res != LCEVC_Success) {
394  av_log(ctx, AV_LOG_ERROR, "LCEVC_SetDecoderEventCallback failed\n");
395  return AVERROR_EXTERNAL;
396  }
397 
398  res = LCEVC_InitializeDecoder(lcevc->decoder);
399  if (res != LCEVC_Success) {
400  av_log(ctx, AV_LOG_ERROR, "LCEVC_InitializeDecoder failed\n");
401  return AVERROR_EXTERNAL;
402  }
403 
404  return 0;
405 }
406 
408 {
409  LCEVCContext *lcevc = ctx->priv;
410 
411  LCEVC_FlushDecoder(lcevc->decoder);
412  flush_bases(ctx);
413  LCEVC_DestroyDecoder(lcevc->decoder);
414 }
415 
416 static const AVFilterPad lcevc_outputs[] = {
417  {
418  .name = "default",
419  .type = AVMEDIA_TYPE_VIDEO,
420  .config_props = config_props,
421  },
422 };
423 
424 static const enum AVPixelFormat pix_fmts[] = {
429 };
430 
432  .p.name = "lcevc",
433  .p.description = NULL_IF_CONFIG_SMALL("LCEVC"),
434  .activate = activate,
438  .priv_size = sizeof(LCEVCContext),
439  .init = init,
440  .uninit = uninit,
441 };
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:117
AVFrame::color_trc
enum AVColorTransferCharacteristic color_trc
Definition: frame.h:682
AVFrame::color_range
enum AVColorRange color_range
MPEG vs JPEG YUV range.
Definition: frame.h:678
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
config_props
static int config_props(AVFilterLink *outlink)
Definition: vf_lcevc.c:274
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
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: filters.h:243
out
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:407
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:680
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:689
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:263
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:427
AVFrame::pts
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:529
AVFrame::width
int width
Definition: frame.h:499
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:777
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
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
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
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:638
lcevc_outputs
static const AVFilterPad lcevc_outputs[]
Definition: vf_lcevc.c:416
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:448
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:1517
dummy
int dummy
Definition: motion.c:64
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:39
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:285
av_cold
#define av_cold
Definition: attributes.h:106
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:266
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:628
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_lcevc.c:369
info
MIPS optimizations info
Definition: mips.txt:2
filters.h
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:231
ctx
AVFormatContext * ctx
Definition: movenc.c:49
receive_frame
static int receive_frame(AVFilterLink *inlink, AVFrame *out)
Definition: vf_lcevc.c:253
AVFrame::crop_right
size_t crop_right
Definition: frame.h:753
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
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:264
alloc_enhanced_frame
static int alloc_enhanced_frame(AVFilterLink *inlink, const AVFrame *out, LCEVC_PictureHandle *picture)
Definition: vf_lcevc.c:168
generate_output
static int generate_output(AVFilterLink *inlink, AVFrame *out)
Definition: vf_lcevc.c:196
activate
static int activate(AVFilterContext *ctx)
Definition: vf_lcevc.c:300
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:424
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:55
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:1464
AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_UNSPECIFIED
Definition: pixfmt.h:743
AVFrame::crop_bottom
size_t crop_bottom
Definition: frame.h:751
AVFrame::crop_left
size_t crop_left
Definition: frame.h:752
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_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
alloc_base_frame
static int alloc_base_frame(AVFilterLink *inlink, const AVFrame *in, LCEVC_PictureHandle *picture)
Definition: vf_lcevc.c:79
AVFrameSideData::data
uint8_t * data
Definition: frame.h:284
AVFrame::format
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition: frame.h:514
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
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
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
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:356
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:45
map_av_range
static enum AVColorRange map_av_range(int range)
Definition: vf_lcevc.c:67
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
AVFrame::sample_aspect_ratio
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
Definition: frame.h:524
flush_bases
static void flush_bases(AVFilterContext *ctx)
Definition: vf_lcevc.c:287
AVFrame::height
int height
Definition: frame.h:499
planes
static const struct @549 planes[]
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:431
AVFilterContext
An instance of a filter.
Definition: avfilter.h:274
desc
const char * desc
Definition: libsvtav1.c:78
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
FFFilter::p
AVFilter p
The public AVFilter.
Definition: filters.h:270
AVFrameSideData
Structure to hold side data for an AVFrame.
Definition: frame.h:282
AVFrame::crop_top
size_t crop_top
Definition: frame.h:750
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:472
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
send_frame
static int send_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_lcevc.c:128