FFmpeg
lcevcdec.c
Go to the documentation of this file.
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 
19 #include "libavutil/avassert.h"
20 #include "libavutil/frame.h"
21 #include "libavutil/imgutils.h"
22 #include "libavutil/log.h"
23 #include "libavutil/mem.h"
24 #include "libavutil/refstruct.h"
25 
26 #include "cbs.h"
27 #include "cbs_lcevc.h"
28 #include "decode.h"
29 #include "lcevc_parse.h"
30 #include "lcevcdec.h"
31 #include "lcevctab.h"
32 
33 static LCEVC_ColorFormat map_format(int format)
34 {
35  switch (format) {
36  case AV_PIX_FMT_YUV420P:
37  return LCEVC_I420_8;
39  return LCEVC_I420_10_LE;
40  case AV_PIX_FMT_NV12:
41  return LCEVC_NV12_8;
42  case AV_PIX_FMT_NV21:
43  return LCEVC_NV21_8;
44  case AV_PIX_FMT_GRAY8:
45  return LCEVC_GRAY_8;
46  }
47 
48  return LCEVC_ColorFormat_Unknown;
49 }
50 
51 static int alloc_base_frame(void *logctx, FFLCEVCContext *lcevc,
52  const AVFrame *frame, LCEVC_PictureHandle *picture)
53 {
54  LCEVC_PictureDesc desc;
55  LCEVC_ColorFormat fmt = map_format(frame->format);
56  LCEVC_PicturePlaneDesc planes[AV_VIDEO_MAX_PLANES] = { 0 };
57  int width = frame->width - frame->crop_left - frame->crop_right;
58  int height = frame->height - frame->crop_top - frame->crop_bottom;
59  LCEVC_ReturnCode res;
60 
61  res = LCEVC_DefaultPictureDesc(&desc, fmt, width, height);
62  if (res != LCEVC_Success)
63  return AVERROR_EXTERNAL;
64 
65  desc.cropTop = frame->crop_top;
66  desc.cropBottom = frame->crop_bottom;
67  desc.cropLeft = frame->crop_left;
68  desc.cropRight = frame->crop_right;
69  desc.sampleAspectRatioNum = frame->sample_aspect_ratio.num;
70  desc.sampleAspectRatioDen = frame->sample_aspect_ratio.den;
71 
72  for (int i = 0; i < AV_VIDEO_MAX_PLANES; i++) {
73  planes[i].firstSample = frame->data[i];
74  planes[i].rowByteStride = frame->linesize[i];
75  }
76 
77  /* Allocate LCEVC Picture */
78  res = LCEVC_AllocPictureExternal(lcevc->decoder, &desc, NULL, planes, picture);
79  if (res != LCEVC_Success) {
80  return AVERROR_EXTERNAL;
81  }
82 
83  return 0;
84 }
85 
86 static int alloc_enhanced_frame(void *logctx, FFLCEVCFrame *frame_ctx,
87  LCEVC_PictureHandle *picture)
88 {
89  FFLCEVCContext *lcevc = frame_ctx->lcevc;
90  LCEVC_PictureDesc desc ;
91  LCEVC_ColorFormat fmt = map_format(frame_ctx->frame->format);
92  LCEVC_PicturePlaneDesc planes[4] = { 0 };
93  LCEVC_ReturnCode res;
94 
95  res = LCEVC_DefaultPictureDesc(&desc, fmt, frame_ctx->frame->width, frame_ctx->frame->height);
96  if (res != LCEVC_Success)
97  return AVERROR_EXTERNAL;
98 
99  /* Set plane description */
100  for (int i = 0; i < 4; i++) {
101  planes[i].firstSample = frame_ctx->frame->data[i];
102  planes[i].rowByteStride = frame_ctx->frame->linesize[i];
103  }
104 
105  /* Allocate LCEVC Picture */
106  res = LCEVC_AllocPictureExternal(lcevc->decoder, &desc, NULL, planes, picture);
107  if (res != LCEVC_Success) {
108  return AVERROR_EXTERNAL;
109  }
110  return 0;
111 }
112 
113 static int lcevc_send_frame(void *logctx, FFLCEVCFrame *frame_ctx, const AVFrame *in)
114 {
115  FFLCEVCContext *lcevc = frame_ctx->lcevc;
117  AVFrame *opaque;
118  LCEVC_PictureHandle picture;
119  LCEVC_ReturnCode res;
120  int ret = 0;
121 
122  if (!sd)
123  return 1;
124 
125  res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, in->pts, sd->data, sd->size);
126  if (res != LCEVC_Success)
127  return AVERROR_EXTERNAL;
128 
129  ret = alloc_base_frame(logctx, lcevc, in, &picture);
130  if (ret < 0)
131  return ret;
132 
133  opaque = av_frame_clone(in);
134  if (!opaque) {
135  LCEVC_FreePicture(lcevc->decoder, picture);
136  return AVERROR(ENOMEM);
137  }
138 
139  res = LCEVC_SetPictureUserData(lcevc->decoder, picture, opaque);
140  if (res != LCEVC_Success) {
141  LCEVC_FreePicture(lcevc->decoder, picture);
142  av_frame_free(&opaque);
143  return AVERROR_EXTERNAL;
144  }
145 
146  res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, picture, -1, opaque);
147  if (res != LCEVC_Success) {
148  LCEVC_FreePicture(lcevc->decoder, picture);
149  av_frame_free(&opaque);
150  return AVERROR_EXTERNAL;
151  }
152 
153  memset(&picture, 0, sizeof(picture));
154  ret = alloc_enhanced_frame(logctx, frame_ctx, &picture);
155  if (ret < 0)
156  return ret;
157 
158  res = LCEVC_SendDecoderPicture(lcevc->decoder, picture);
159  if (res != LCEVC_Success) {
160  LCEVC_FreePicture(lcevc->decoder, picture);
161  return AVERROR_EXTERNAL;
162  }
163 
164  return 0;
165 }
166 
167 static int generate_output(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
168 {
169  FFLCEVCContext *lcevc = frame_ctx->lcevc;
170  LCEVC_PictureDesc desc;
171  LCEVC_DecodeInformation info;
172  LCEVC_PictureHandle picture;
173  LCEVC_ReturnCode res;
174 
175  res = LCEVC_ReceiveDecoderPicture(lcevc->decoder, &picture, &info);
176  if (res != LCEVC_Success)
177  return AVERROR_EXTERNAL;
178 
179  res = LCEVC_GetPictureDesc(lcevc->decoder, picture, &desc);
180  if (res != LCEVC_Success) {
181  LCEVC_FreePicture(lcevc->decoder, picture);
182  return AVERROR_EXTERNAL;
183  }
184 
186  av_frame_copy_props(frame_ctx->frame, (AVFrame *)info.baseUserData);
187  av_frame_move_ref(out, frame_ctx->frame);
188 
189  out->crop_top = desc.cropTop;
190  out->crop_bottom = desc.cropBottom;
191  out->crop_left = desc.cropLeft;
192  out->crop_right = desc.cropRight;
193  out->sample_aspect_ratio.num = desc.sampleAspectRatioNum;
194  out->sample_aspect_ratio.den = desc.sampleAspectRatioDen;
195  out->width = desc.width + out->crop_left + out->crop_right;
196  out->height = desc.height + out->crop_top + out->crop_bottom;
197 
198  av_log(logctx, AV_LOG_DEBUG, "out PTS %"PRId64", %dx%d, "
199  "%zu/%zu/%zu/%zu, "
200  "SAR %d:%d, "
201  "hasEnhancement %d, enhanced %d\n",
202  out->pts, out->width, out->height,
203  out->crop_top, out->crop_bottom, out->crop_left, out->crop_right,
204  out->sample_aspect_ratio.num, out->sample_aspect_ratio.den,
205  info.hasEnhancement, info.enhanced);
206 
207  res = LCEVC_FreePicture(lcevc->decoder, picture);
208  if (res != LCEVC_Success)
209  return AVERROR_EXTERNAL;
210 
211  return 0;
212 }
213 
215 {
216  LCEVC_PictureHandle picture;
217  LCEVC_ReturnCode res;
218 
219  while (1) {
220  AVFrame *base = NULL;
221  res = LCEVC_ReceiveDecoderBase (lcevc->decoder, &picture);
222  if (res != LCEVC_Success && res != LCEVC_Again)
223  return AVERROR_EXTERNAL;
224 
225  if (res == LCEVC_Again)
226  break;
227 
228  LCEVC_GetPictureUserData(lcevc->decoder, picture, (void **)&base);
230 
231  res = LCEVC_FreePicture(lcevc->decoder, picture);
232  if (res != LCEVC_Success)
233  return AVERROR_EXTERNAL;
234  }
235 
236  return 0;
237 }
238 
239 static int lcevc_receive_frame(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
240 {
241  FFLCEVCContext *lcevc = frame_ctx->lcevc;
242  int ret;
243 
244  ret = generate_output(logctx, frame_ctx, out);
245  if (ret < 0)
246  return ret;
247 
248  return lcevc_flush_pictures(lcevc);
249 }
250 
251 static void event_callback(LCEVC_DecoderHandle dec, LCEVC_Event event,
252  LCEVC_PictureHandle pic, const LCEVC_DecodeInformation *info,
253  const uint8_t *data, uint32_t size, void *logctx)
254 {
255  switch (event) {
256  case LCEVC_Log:
257  av_log(logctx, AV_LOG_INFO, "%s\n", data);
258  break;
259  default:
260  break;
261  }
262 }
263 
264 static void lcevc_free(AVRefStructOpaque unused, void *obj)
265 {
266  FFLCEVCContext *lcevc = obj;
267  if (lcevc->initialized) {
268  LCEVC_FlushDecoder(lcevc->decoder);
269  lcevc_flush_pictures(lcevc);
270  LCEVC_DestroyDecoder(lcevc->decoder);
271  }
272  if (lcevc->frag)
273  ff_cbs_fragment_free(lcevc->frag);
274  av_freep(&lcevc->frag);
275  ff_cbs_close(&lcevc->cbc);
276  memset(lcevc, 0, sizeof(*lcevc));
277 }
278 
279 static int lcevc_init(FFLCEVCContext *lcevc, void *logctx)
280 {
281  LCEVC_AccelContextHandle dummy = { 0 };
282  const int32_t event = LCEVC_Log;
283 
284  if (LCEVC_CreateDecoder(&lcevc->decoder, dummy) != LCEVC_Success) {
285  av_log(logctx, AV_LOG_ERROR, "Failed to create LCEVC decoder\n");
286  return AVERROR_EXTERNAL;
287  }
288 
289  LCEVC_ConfigureDecoderInt(lcevc->decoder, "log_level", 4);
290  LCEVC_ConfigureDecoderIntArray(lcevc->decoder, "events", 1, &event);
291  LCEVC_SetDecoderEventCallback(lcevc->decoder, event_callback, logctx);
292 
293  if (LCEVC_InitializeDecoder(lcevc->decoder) != LCEVC_Success) {
294  av_log(logctx, AV_LOG_ERROR, "Failed to initialize LCEVC decoder\n");
295  LCEVC_DestroyDecoder(lcevc->decoder);
296  return AVERROR_EXTERNAL;
297  }
298 
299  lcevc->initialized = 1;
300 
301  return 0;
302 }
303 
304 int ff_lcevc_process(void *logctx, AVFrame *frame)
305 {
306  FrameDecodeData *fdd = frame->private_ref;
307  FFLCEVCFrame *frame_ctx = fdd->post_process_opaque;
308  FFLCEVCContext *lcevc = frame_ctx->lcevc;
309  int ret;
310 
311  if (!lcevc->initialized) {
312  ret = lcevc_init(lcevc, logctx);
313  if (ret < 0)
314  return ret;
315  }
316 
317  av_assert0(frame_ctx->frame);
318 
319 
320  ret = lcevc_send_frame(logctx, frame_ctx, frame);
321  if (ret)
322  return ret < 0 ? ret : 0;
323 
324  ret = lcevc_receive_frame(logctx, frame_ctx, frame);
325  if (ret < 0)
326  return ret;
327 
329 
330  return 0;
331 }
332 
334  int *width, int *height, void *logctx)
335 {
339  int ret;
340 
341  ret = ff_cbs_read(lcevc->cbc, lcevc->frag, sd->buf, sd->data, sd->size);
342  if (ret < 0) {
343  av_log(logctx, AV_LOG_ERROR, "Failed to parse Access Unit.\n");
344  goto end;
345  }
346 
347  ret = ff_cbs_lcevc_find_process_block(lcevc->cbc, lcevc->frag,
349  if (ret < 0) {
350  ret = 0;
351  goto end;
352  }
353 
354  gc = block->payload;
355  if (gc->resolution_type < 63) {
358  } else {
361  }
362 
363  ret = 0;
364 end:
365  ff_cbs_fragment_reset(lcevc->frag);
366 
367  return ret;
368 }
369 
372 };
373 
374 int ff_lcevc_alloc(FFLCEVCContext **plcevc, void *logctx)
375 {
376  FFLCEVCContext *lcevc = NULL;
377  int ret;
378 
379  lcevc = av_refstruct_alloc_ext(sizeof(*lcevc), 0, NULL, lcevc_free);
380  if (!lcevc)
381  return AVERROR(ENOMEM);
382 
383  lcevc->frag = av_mallocz(sizeof(*lcevc->frag));
384  if (!lcevc->frag) {
385  ret = AVERROR(ENOMEM);
386  goto fail;
387  }
388 
389  ret = ff_cbs_init(&lcevc->cbc, AV_CODEC_ID_LCEVC, logctx);
390  if (ret < 0)
391  goto fail;
392 
395 
396  *plcevc = lcevc;
397  return 0;
398 fail:
399  av_refstruct_unref(&lcevc);
400  return ret;
401 }
402 
403 void ff_lcevc_unref(void *opaque)
404 {
405  FFLCEVCFrame *lcevc = opaque;
406  av_refstruct_unref(&lcevc->lcevc);
407  av_frame_free(&lcevc->frame);
408  av_free(opaque);
409 }
lcevcdec.h
cbs.h
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
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
AVRefStructOpaque
RefStruct is an API for creating reference-counted objects with minimal overhead.
Definition: refstruct.h:58
AV_VIDEO_MAX_PLANES
#define AV_VIDEO_MAX_PLANES
Maximum number of planes in any pixel format.
Definition: pixfmt.h:40
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
FrameDecodeData
This struct stores per-frame lavc-internal data and is attached to it via private_ref.
Definition: decode.h:33
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:427
AVFrameSideData::buf
AVBufferRef * buf
Definition: frame.h:287
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
FFLCEVCContext
Definition: lcevcdec.h:34
data
const char data[16]
Definition: mxf.c:149
lcevc_init
static int lcevc_init(FFLCEVCContext *lcevc, void *logctx)
Definition: lcevcdec.c:279
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:539
LCEVCRawGlobalConfig::custom_resolution_width
uint16_t custom_resolution_width
Definition: cbs_lcevc.h:82
base
uint8_t base
Definition: vp3data.h:128
FFLCEVCContext::initialized
int initialized
Definition: lcevcdec.h:38
lcevc_parse.h
ff_lcevc_resolution_type
const struct FFLCEVCDim ff_lcevc_resolution_type[63]
Definition: lcevctab.c:21
LCEVCRawGlobalConfig
Definition: cbs_lcevc.h:49
FFLCEVCContext::decoder
LCEVC_DecoderHandle decoder
Definition: lcevcdec.h:35
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:448
lcevc_flush_pictures
static int lcevc_flush_pictures(FFLCEVCContext *lcevc)
Definition: lcevcdec.c:214
cbs_lcevc.h
fail
#define fail()
Definition: checkasm.h:221
dummy
int dummy
Definition: motion.c:64
ff_lcevc_process
int ff_lcevc_process(void *logctx, AVFrame *frame)
Definition: lcevcdec.c:304
refstruct.h
avassert.h
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
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
FrameDecodeData::post_process_opaque
void * post_process_opaque
Definition: decode.h:45
info
MIPS optimizations info
Definition: mips.txt:2
lcevc_free
static void lcevc_free(AVRefStructOpaque unused, void *obj)
Definition: lcevcdec.c:264
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:42
av_refstruct_alloc_ext
static void * av_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, void(*free_cb)(AVRefStructOpaque opaque, void *obj))
A wrapper around av_refstruct_alloc_ext_c() for the common case of a non-const qualified opaque.
Definition: refstruct.h:94
CodedBitstreamUnitType
uint32_t CodedBitstreamUnitType
The codec-specific type of a bitstream unit.
Definition: cbs.h:54
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:231
decode.h
av_frame_clone
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition: frame.c:483
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
av_mallocz
#define av_mallocz(s)
Definition: tableprint_vlc.h:31
map_format
static LCEVC_ColorFormat map_format(int format)
Definition: lcevcdec.c:33
FFLCEVCContext::cbc
struct CodedBitstreamContext * cbc
Definition: lcevcdec.h:36
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
ff_lcevc_unref
void ff_lcevc_unref(void *opaque)
Definition: lcevcdec.c:403
FFLCEVCFrame::lcevc
FFLCEVCContext * lcevc
Definition: lcevcdec.h:44
LCEVCRawGlobalConfig::resolution_type
uint8_t resolution_type
Definition: cbs_lcevc.h:51
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
alloc_base_frame
static int alloc_base_frame(void *logctx, FFLCEVCContext *lcevc, const AVFrame *frame, LCEVC_PictureHandle *picture)
Definition: lcevcdec.c:51
event_callback
static void event_callback(LCEVC_DecoderHandle dec, LCEVC_Event event, LCEVC_PictureHandle pic, const LCEVC_DecodeInformation *info, const uint8_t *data, uint32_t size, void *logctx)
Definition: lcevcdec.c:251
height
#define height
Definition: dsp.h:89
i
#define i(width, name, range_min, range_max)
Definition: cbs_h264.c:63
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
AVFrameSideData::data
uint8_t * data
Definition: frame.h:284
generate_output
static int generate_output(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
Definition: lcevcdec.c:167
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
LCEVCRawProcessBlock
Definition: cbs_lcevc.h:175
frame.h
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
AV_CODEC_ID_LCEVC
@ AV_CODEC_ID_LCEVC
Definition: codec_id.h:615
alloc_enhanced_frame
static int alloc_enhanced_frame(void *logctx, FFLCEVCFrame *frame_ctx, LCEVC_PictureHandle *picture)
Definition: lcevcdec.c:86
FFLCEVCDim::height
uint16_t height
Definition: lcevctab.h:28
LCEVCRawGlobalConfig::custom_resolution_height
uint16_t custom_resolution_height
Definition: cbs_lcevc.h:83
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:221
av_refstruct_unref
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
Definition: refstruct.c:120
log.h
av_frame_move_ref
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
Definition: frame.c:523
av_frame_unref
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
Definition: frame.c:496
decompose_unit_types
static const CodedBitstreamUnitType decompose_unit_types[]
Definition: lcevcdec.c:370
AV_PIX_FMT_NV21
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
Definition: pixfmt.h:97
FFLCEVCDim::width
uint16_t width
Definition: lcevctab.h:27
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
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:265
lcevctab.h
AVFrame::height
int height
Definition: frame.h:499
lcevc_send_frame
static int lcevc_send_frame(void *logctx, FFLCEVCFrame *frame_ctx, const AVFrame *in)
Definition: lcevcdec.c:113
desc
const char * desc
Definition: libsvtav1.c:82
mem.h
ff_lcevc_parse_frame
int ff_lcevc_parse_frame(FFLCEVCContext *lcevc, const AVFrame *frame, int *width, int *height, void *logctx)
Definition: lcevcdec.c:333
AVFrameSideData
Structure to hold side data for an AVFrame.
Definition: frame.h:282
av_free
#define av_free(p)
Definition: tableprint_vlc.h:34
ff_cbs_lcevc_find_process_block
int ff_cbs_lcevc_find_process_block(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type, LCEVCRawProcessBlock **iter)
Iterate over blocks with the given payload type in an access unit.
Definition: cbs_lcevc.c:665
CodedBitstreamContext::nb_decompose_unit_types
int nb_decompose_unit_types
Length of the decompose_unit_types array.
Definition: cbs.h:259
CodedBitstreamContext::decompose_unit_types
const CodedBitstreamUnitType * decompose_unit_types
Array of unit types which should be decomposed when reading.
Definition: cbs.h:255
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
LCEVC_PAYLOAD_TYPE_GLOBAL_CONFIG
@ LCEVC_PAYLOAD_TYPE_GLOBAL_CONFIG
Definition: lcevc.h:71
ff_lcevc_alloc
int ff_lcevc_alloc(FFLCEVCContext **plcevc, void *logctx)
Definition: lcevcdec.c:374
int32_t
int32_t
Definition: audioconvert.c:56
FFLCEVCContext::frag
struct CodedBitstreamFragment * frag
Definition: lcevcdec.h:37
imgutils.h
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
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
width
#define width
Definition: dsp.h:89
FFLCEVCFrame
Definition: lcevcdec.h:43
planes
static const struct @568 planes[]
LCEVC_IDR_NUT
@ LCEVC_IDR_NUT
Definition: lcevc.h:61
FFLCEVCFrame::frame
struct AVFrame * frame
Definition: lcevcdec.h:45
lcevc_receive_frame
static int lcevc_receive_frame(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
Definition: lcevcdec.c:239