FFmpeg
Loading...
Searching...
No Matches
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
33static LCEVC_ColorFormat map_format(int format)
34{
35 switch (format) {
37 return LCEVC_I420_8;
39 return LCEVC_I420_10_LE;
41 return LCEVC_I420_12_LE;
43 return LCEVC_I420_14_LE;
45 return LCEVC_I422_8;
47 return LCEVC_I422_10_LE;
49 return LCEVC_I422_12_LE;
51 return LCEVC_I422_14_LE;
53 return LCEVC_I444_8;
55 return LCEVC_I444_10_LE;
57 return LCEVC_I444_12_LE;
59 return LCEVC_I444_14_LE;
60 case AV_PIX_FMT_NV12:
61 return LCEVC_NV12_8;
62 case AV_PIX_FMT_NV21:
63 return LCEVC_NV21_8;
65 return LCEVC_GRAY_8;
67 return LCEVC_GRAY_10_LE;
69 return LCEVC_GRAY_12_LE;
71 return LCEVC_GRAY_14_LE;
72 }
73
74 return LCEVC_ColorFormat_Unknown;
75}
76
78 const AVFrame *frame, LCEVC_PictureHandle *picture)
79{
80 LCEVC_PictureDesc desc;
81 LCEVC_ColorFormat fmt = map_format(frame->format);
82 LCEVC_PicturePlaneDesc planes[AV_VIDEO_MAX_PLANES] = { 0 };
83 int width = frame->width - frame->crop_left - frame->crop_right;
84 int height = frame->height - frame->crop_top - frame->crop_bottom;
85 LCEVC_ReturnCode res;
86
87 res = LCEVC_DefaultPictureDesc(&desc, fmt, width, height);
88 if (res != LCEVC_Success)
89 return AVERROR_EXTERNAL;
90
91 desc.cropTop = frame->crop_top;
92 desc.cropBottom = frame->crop_bottom;
93 desc.cropLeft = frame->crop_left;
94 desc.cropRight = frame->crop_right;
95 desc.sampleAspectRatioNum = frame->sample_aspect_ratio.num;
96 desc.sampleAspectRatioDen = frame->sample_aspect_ratio.den;
97
98 for (int i = 0; i < AV_VIDEO_MAX_PLANES; i++) {
99 planes[i].firstSample = frame->data[i];
100 planes[i].rowByteStride = frame->linesize[i];
101 }
102
103 /* Allocate LCEVC Picture */
104 res = LCEVC_AllocPictureExternal(lcevc->decoder, &desc, NULL, planes, picture);
105 if (res != LCEVC_Success) {
106 return AVERROR_EXTERNAL;
107 }
108
109 return 0;
110}
111
112static int alloc_enhanced_frame(FFLCEVCFrame *frame_ctx,
113 LCEVC_PictureHandle *picture)
114{
115 FFLCEVCContext *lcevc = frame_ctx->lcevc;
116 LCEVC_PictureDesc desc ;
117 LCEVC_ColorFormat fmt = map_format(frame_ctx->frame->format);
118 LCEVC_PicturePlaneDesc planes[4] = { 0 };
119 LCEVC_ReturnCode res;
120
121 res = LCEVC_DefaultPictureDesc(&desc, fmt, frame_ctx->frame->width, frame_ctx->frame->height);
122 if (res != LCEVC_Success)
123 return AVERROR_EXTERNAL;
124
125 /* Set plane description */
126 for (int i = 0; i < 4; i++) {
127 planes[i].firstSample = frame_ctx->frame->data[i];
128 planes[i].rowByteStride = frame_ctx->frame->linesize[i];
129 }
130
131 /* Allocate LCEVC Picture */
132 res = LCEVC_AllocPictureExternal(lcevc->decoder, &desc, NULL, planes, picture);
133 if (res != LCEVC_Success) {
134 return AVERROR_EXTERNAL;
135 }
136 return 0;
137}
138
139static int lcevc_send_frame(FFLCEVCFrame *frame_ctx, const AVFrame *in)
140{
141 FFLCEVCContext *lcevc = frame_ctx->lcevc;
142 LCEVC_ColorFormat fmt = map_format(in->format);
144 AVFrame *opaque;
145 LCEVC_PictureHandle picture;
146 LCEVC_ReturnCode res;
147 int ret;
148
149 if (!sd || fmt == LCEVC_ColorFormat_Unknown)
150 return 1;
151
152 res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, lcevc->last_pts,
153 sd->data, sd->size);
154 if (res != LCEVC_Success) {
155 ret = AVERROR_EXTERNAL;
156 goto end;
157 }
158
159 ret = alloc_base_frame(lcevc, in, &picture);
160 if (ret < 0)
161 goto end;
162
163 opaque = av_frame_clone(in);
164 if (!opaque) {
165 LCEVC_FreePicture(lcevc->decoder, picture);
166 ret = AVERROR(ENOMEM);
167 goto end;
168 }
169
170 res = LCEVC_SetPictureUserData(lcevc->decoder, picture, opaque);
171 if (res != LCEVC_Success) {
172 LCEVC_FreePicture(lcevc->decoder, picture);
173 av_frame_free(&opaque);
174 ret = AVERROR_EXTERNAL;
175 goto end;
176 }
177
178 res = LCEVC_SendDecoderBase(lcevc->decoder, lcevc->last_pts, picture, -1, opaque);
179 if (res != LCEVC_Success) {
180 LCEVC_FreePicture(lcevc->decoder, picture);
181 av_frame_free(&opaque);
182 ret = AVERROR_EXTERNAL;
183 goto end;
184 }
185
186 memset(&picture, 0, sizeof(picture));
187 ret = alloc_enhanced_frame(frame_ctx, &picture);
188 if (ret < 0)
189 goto end;
190
191 res = LCEVC_SendDecoderPicture(lcevc->decoder, picture);
192 if (res != LCEVC_Success) {
193 LCEVC_FreePicture(lcevc->decoder, picture);
194 ret = AVERROR_EXTERNAL;
195 goto end;
196 }
197
198 ret = 0;
199end:
200 lcevc->last_pts++;
201
202 return ret;
203}
204
205static int generate_output(FFLCEVCFrame *frame_ctx, AVFrame *out)
206{
207 FFLCEVCContext *lcevc = frame_ctx->lcevc;
208 LCEVC_PictureDesc desc;
209 LCEVC_DecodeInformation info;
210 LCEVC_PictureHandle picture;
211 LCEVC_ReturnCode res;
212
213 do {
214 res = LCEVC_ReceiveDecoderPicture(lcevc->decoder, &picture, &info);
215 } while (res == LCEVC_Again);
216 if (res != LCEVC_Success)
217 return AVERROR_EXTERNAL;
218
219 res = LCEVC_GetPictureDesc(lcevc->decoder, picture, &desc);
220 if (res != LCEVC_Success) {
221 LCEVC_FreePicture(lcevc->decoder, picture);
222 return AVERROR_EXTERNAL;
223 }
224
226 av_frame_copy_props(frame_ctx->frame, (AVFrame *)info.baseUserData);
227 av_frame_move_ref(out, frame_ctx->frame);
228
229 out->crop_top = desc.cropTop;
230 out->crop_bottom = desc.cropBottom;
231 out->crop_left = desc.cropLeft;
232 out->crop_right = desc.cropRight;
233 out->sample_aspect_ratio.num = desc.sampleAspectRatioNum;
234 out->sample_aspect_ratio.den = desc.sampleAspectRatioDen;
235 out->width = desc.width + out->crop_left + out->crop_right;
236 out->height = desc.height + out->crop_top + out->crop_bottom;
237
238 av_log(lcevc, AV_LOG_DEBUG, "out PTS %"PRId64", %dx%d, "
239 "%zu/%zu/%zu/%zu, "
240 "SAR %d:%d, "
241 "hasEnhancement %d, enhanced %d\n",
242 out->pts, out->width, out->height,
243 out->crop_top, out->crop_bottom, out->crop_left, out->crop_right,
244 out->sample_aspect_ratio.num, out->sample_aspect_ratio.den,
245 info.hasEnhancement, info.enhanced);
246
247 res = LCEVC_FreePicture(lcevc->decoder, picture);
248 if (res != LCEVC_Success)
249 return AVERROR_EXTERNAL;
250
251 return 0;
252}
253
255{
256 LCEVC_PictureHandle picture;
257 LCEVC_ReturnCode res;
258
259 while (1) {
260 AVFrame *base = NULL;
261 res = LCEVC_ReceiveDecoderBase (lcevc->decoder, &picture);
262 if (res != LCEVC_Success && res != LCEVC_Again)
263 return AVERROR_EXTERNAL;
264
265 if (res == LCEVC_Again)
266 break;
267
268 LCEVC_GetPictureUserData(lcevc->decoder, picture, (void **)&base);
270
271 res = LCEVC_FreePicture(lcevc->decoder, picture);
272 if (res != LCEVC_Success)
273 return AVERROR_EXTERNAL;
274 }
275
276 return 0;
277}
278
280{
281 FFLCEVCContext *lcevc = frame_ctx->lcevc;
282 int ret;
283
284 ret = generate_output(frame_ctx, out);
285 if (ret < 0)
286 return ret;
287
288 return lcevc_flush_pictures(lcevc);
289}
290
291static const uint8_t level_map[LCEVC_LogLevelCount] = {
292 [LCEVC_LogFatal] = AV_LOG_FATAL,
293 [LCEVC_LogError] = AV_LOG_ERROR,
294 [LCEVC_LogWarning] = AV_LOG_WARNING,
295 [LCEVC_LogInfo] = AV_LOG_INFO,
296 [LCEVC_LogDebug] = AV_LOG_DEBUG,
297 [LCEVC_LogTrace] = AV_LOG_TRACE,
298};
299
300static void event_callback(LCEVC_DecoderHandle dec, LCEVC_Event event,
301 LCEVC_PictureHandle pic, const LCEVC_DecodeInformation *info,
302 const uint8_t *data, uint32_t size, void *logctx)
303{
304 switch (event) {
305 case LCEVC_Log: {
306 unsigned int level = 0;
307 if (size < 3)
308 break;
309 int ret = sscanf(data, "%u ", &level);
310 if (ret != 1 || level >= LCEVC_LogLevelCount || !level_map[level])
311 break;
312 av_log(logctx, level_map[level], "%s\n", data + 2);
313 break;
314 }
315 default:
316 break;
317 }
318}
319
320static void lcevc_free(AVRefStructOpaque unused, void *obj)
321{
322 FFLCEVCContext *lcevc = obj;
323 if (lcevc->initialized) {
324 LCEVC_FlushDecoder(lcevc->decoder);
326 LCEVC_DestroyDecoder(lcevc->decoder);
327 }
328 if (lcevc->frag)
329 ff_cbs_fragment_free(lcevc->frag);
330 av_freep(&lcevc->frag);
331 ff_cbs_close(&lcevc->cbc);
333 memset(lcevc, 0, sizeof(*lcevc));
334}
335
336static av_cold int lcevc_frame_init_cb(AVRefStructOpaque unused, void *obj)
337{
338 FFLCEVCFrame *frame = obj;
339
340 frame->frame = av_frame_alloc();
341 if (!frame->frame)
342 return AVERROR(ENOMEM);
343 return 0;
344}
345
346static void lcevc_frame_reset_cb(AVRefStructOpaque unused, void *obj)
347{
348 FFLCEVCFrame *frame = obj;
349
350 av_frame_unref(frame->frame);
351 av_refstruct_unref(&frame->lcevc);
352}
353
355{
356 FFLCEVCFrame *frame = obj;
357
358 av_frame_free(&frame->frame);
359}
360
361static int get_log_level(int level)
362{
363 if (level <= AV_LOG_QUIET)
364 return LCEVC_LogDisabled;
365 if (level <= AV_LOG_FATAL)
366 return LCEVC_LogFatal;
367 if (level <= AV_LOG_ERROR)
368 return LCEVC_LogError;
369 if (level <= AV_LOG_WARNING)
370 return LCEVC_LogWarning;
371 if (level <= AV_LOG_INFO)
372 return LCEVC_LogInfo;
373 if (level <= AV_LOG_DEBUG)
374 return LCEVC_LogDebug;
375
376 return LCEVC_LogTrace;
377}
378
379static int lcevc_init(FFLCEVCContext *lcevc)
380{
381 LCEVC_AccelContextHandle dummy = { 0 };
382 const int32_t event = LCEVC_Log;
383 int level;
384
385 if (LCEVC_CreateDecoder(&lcevc->decoder, dummy) != LCEVC_Success) {
386 av_log(lcevc, AV_LOG_ERROR, "Failed to create LCEVC decoder\n");
387 return AVERROR_EXTERNAL;
388 }
389
390 level = get_log_level(lcevc->loglevel);
391
392 LCEVC_ConfigureDecoderInt(lcevc->decoder, "log_level", level);
393 LCEVC_ConfigureDecoderIntArray(lcevc->decoder, "events", 1, &event);
394 LCEVC_SetDecoderEventCallback(lcevc->decoder, event_callback, lcevc);
395
396 if (LCEVC_InitializeDecoder(lcevc->decoder) != LCEVC_Success) {
397 av_log(lcevc, AV_LOG_ERROR, "Failed to initialize LCEVC decoder\n");
398 LCEVC_DestroyDecoder(lcevc->decoder);
399 return AVERROR_EXTERNAL;
400 }
401
402 lcevc->initialized = 1;
403
404 return 0;
405}
406
407int ff_lcevc_process(void *logctx, AVFrame *frame)
408{
409 FrameDecodeData *fdd = frame->private_ref;
410 FFLCEVCFrame *frame_ctx = fdd->post_process_opaque;
411 FFLCEVCContext *lcevc = frame_ctx->lcevc;
412 int ret;
413
414 if (!lcevc->initialized) {
415 ret = lcevc_init(lcevc);
416 if (ret < 0)
417 return ret;
418 }
419
420 av_assert0(frame_ctx->frame);
421
422
423 ret = lcevc_send_frame(frame_ctx, frame);
424 if (ret)
425 return ret < 0 ? ret : 0;
426
427 ret = lcevc_receive_frame(frame_ctx, frame);
428 if (ret < 0)
429 return ret;
430
432
433 return 0;
434}
435
437 enum AVPixelFormat *format, int *width, int *height)
438{
440 const LCEVCRawGlobalConfig *gc;
442 int ret;
443
444 ret = ff_cbs_read(lcevc->cbc, lcevc->frag, NULL, sd->data, sd->size);
445 if (ret < 0) {
446 av_log(lcevc, AV_LOG_ERROR, "Failed to parse Access Unit.\n");
447 goto end;
448 }
449
450 ret = ff_cbs_lcevc_find_process_block(lcevc->cbc, lcevc->frag,
452 if (ret < 0) {
453 ret = 0;
454 goto end;
455 }
456
457 gc = block->payload;
458
460 if (gc->resolution_type < 63) {
463 } else {
466 }
467
468 ret = 0;
469end:
470 ff_cbs_fragment_reset(lcevc->frag);
471
472 return ret;
473}
474
479
480
482 .class_name = "liblcevc_dec",
483 .item_name = av_default_item_name,
484 .version = LIBAVUTIL_VERSION_INT,
485 .category = AV_CLASS_CATEGORY_DECODER,
486};
487
488int ff_lcevc_alloc(FFLCEVCContext **plcevc, int loglevel)
489{
490 FFLCEVCContext *lcevc = NULL;
491 int ret;
492
493 lcevc = av_refstruct_alloc_ext(sizeof(*lcevc), 0, NULL, lcevc_free);
494 if (!lcevc)
495 return AVERROR(ENOMEM);
496
497 lcevc->frag = av_mallocz(sizeof(*lcevc->frag));
498 if (!lcevc->frag) {
499 ret = AVERROR(ENOMEM);
500 goto fail;
501 }
502
503 ret = ff_cbs_init(&lcevc->cbc, AV_CODEC_ID_LCEVC, lcevc);
504 if (ret < 0)
505 goto fail;
506
509
514 if (!lcevc->frame_pool) {
515 ret = AVERROR(ENOMEM);
516 goto fail;
517 }
518
520 lcevc->loglevel = loglevel;
521
522 *plcevc = lcevc;
523 return 0;
524fail:
525 av_refstruct_unref(&lcevc);
526 return ret;
527}
static const char *const format[]
Definition af_aiir.c:445
static FILE * out
static const CodedBitstreamUnitType decompose_unit_types[]
Definition apv_parser.c:178
int32_t
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition avassert.h:42
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
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:662
#define NULL
Definition coverity.c:32
static int16_t block[64]
Definition dct.c:125
static AVFrame * frame
static int dummy
Definition ffplay.c:3754
reference-counted frame API
#define fail
Definition test.h:479
@ AV_CODEC_ID_LCEVC
Definition codec_id.h:609
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition error.h:59
#define AVERROR(e)
Definition error.h:45
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
Definition frame.c:496
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_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
Definition frame.c:523
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
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition frame.c:52
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition frame.c:483
@ 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_TRACE
Extremely verbose debugging, useful for libav* development.
Definition log.h:236
#define AV_LOG_QUIET
Print no output.
Definition log.h:192
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition log.h:231
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition log.h:216
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
Definition log.h:204
#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
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
misc image utilities
static LCEVC_ColorFormat map_format(int format)
Definition lcevcdec.c:33
static av_cold int lcevc_frame_init_cb(AVRefStructOpaque unused, void *obj)
Definition lcevcdec.c:336
static int alloc_base_frame(FFLCEVCContext *lcevc, const AVFrame *frame, LCEVC_PictureHandle *picture)
Definition lcevcdec.c:77
static void lcevc_frame_reset_cb(AVRefStructOpaque unused, void *obj)
Definition lcevcdec.c:346
int ff_lcevc_parse_frame(FFLCEVCContext *lcevc, const AVFrame *frame, enum AVPixelFormat *format, int *width, int *height)
Definition lcevcdec.c:436
static int alloc_enhanced_frame(FFLCEVCFrame *frame_ctx, LCEVC_PictureHandle *picture)
Definition lcevcdec.c:112
static int generate_output(FFLCEVCFrame *frame_ctx, AVFrame *out)
Definition lcevcdec.c:205
int ff_lcevc_process(void *logctx, AVFrame *frame)
Definition lcevcdec.c:407
static int lcevc_receive_frame(FFLCEVCFrame *frame_ctx, AVFrame *out)
Definition lcevcdec.c:279
static int lcevc_flush_pictures(FFLCEVCContext *lcevc)
Definition lcevcdec.c:254
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:300
static av_cold void lcevc_frame_free_entry_cb(AVRefStructOpaque unused, void *obj)
Definition lcevcdec.c:354
static const uint8_t level_map[LCEVC_LogLevelCount]
Definition lcevcdec.c:291
static int lcevc_send_frame(FFLCEVCFrame *frame_ctx, const AVFrame *in)
Definition lcevcdec.c:139
static int lcevc_init(FFLCEVCContext *lcevc)
Definition lcevcdec.c:379
int ff_lcevc_alloc(FFLCEVCContext **plcevc, int loglevel)
Definition lcevcdec.c:488
static void lcevc_free(AVRefStructOpaque unused, void *obj)
Definition lcevcdec.c:320
static const AVClass lcevcdec_context_class
Definition lcevcdec.c:481
uintptr_t LCEVC_DecoderHandle
Definition lcevcdec.h:31
uint32_t CodedBitstreamUnitType
The codec-specific type of a bitstream unit.
Definition cbs.h:66
@ LCEVC_PAYLOAD_TYPE_GLOBAL_CONFIG
Definition lcevc.h:71
@ LCEVC_NON_IDR_NUT
Definition lcevc.h:60
@ LCEVC_IDR_NUT
Definition lcevc.h:61
enum AVPixelFormat ff_lcevc_depth_type[4][4]
Definition lcevctab.c:38
const struct FFLCEVCDim ff_lcevc_resolution_type[63]
Definition lcevctab.c:22
#define av_cold
Definition attributes.h:117
const char * desc
Definition libsvtav1.c:83
static const struct @257111027162314367033347246032313251342043035002 planes[]
@ AV_CLASS_CATEGORY_DECODER
Definition log.h:35
Memory handling functions.
const char data[16]
Definition mxf.c:149
#define AV_PIX_FMT_YUV444P12
Definition pixfmt.h:552
#define AV_PIX_FMT_YUV420P10
Definition pixfmt.h:545
#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
#define AV_PIX_FMT_YUV420P14
Definition pixfmt.h:553
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_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_GRAY14LE
Y , 14bpp, little-endian.
Definition pixfmt.h:361
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
#define AV_PIX_FMT_YUV422P14
Definition pixfmt.h:554
#define AV_PIX_FMT_YUV444P14
Definition pixfmt.h:555
#define AV_PIX_FMT_YUV444P10
Definition pixfmt.h:548
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
static void av_refstruct_pool_uninit(AVRefStructPool **poolp)
Mark the pool as being available for freeing.
Definition refstruct.h:292
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
static AVRefStructPool * av_refstruct_pool_alloc_ext(size_t size, unsigned flags, void *opaque, int(*init_cb)(AVRefStructOpaque opaque, void *obj), void(*reset_cb)(AVRefStructOpaque opaque, void *obj), void(*free_entry_cb)(AVRefStructOpaque opaque, void *obj), void(*free_cb)(AVRefStructOpaque opaque))
A wrapper around av_refstruct_pool_alloc_ext_c() for the common case of a non-const qualified opaque.
Definition refstruct.h:258
#define FF_ARRAY_ELEMS(a)
Describe the class of an AVClass context structure.
Definition log.h:76
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
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
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
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition frame.h:559
const CodedBitstreamUnitType * decompose_unit_types
Array of unit types which should be decomposed when reading.
Definition cbs.h:255
int nb_decompose_unit_types
Length of the decompose_unit_types array.
Definition cbs.h:259
struct CodedBitstreamContext * cbc
Definition lcevcdec.h:40
int64_t last_pts
Definition lcevcdec.h:43
LCEVC_DecoderHandle decoder
Definition lcevcdec.h:39
struct CodedBitstreamFragment * frag
Definition lcevcdec.h:41
struct AVRefStructPool * frame_pool
pool of FFLCEVCFrame
Definition lcevcdec.h:42
const AVClass * class
Definition lcevcdec.h:38
FFLCEVCContext * lcevc
Definition lcevcdec.h:51
struct AVFrame * frame
Definition lcevcdec.h:52
This struct stores per-frame lavc-internal data and is attached to it via private_ref.
Definition decode.h:33
void * post_process_opaque
RefStruct reference.
Definition decode.h:45
uint8_t chroma_sampling_type
Definition cbs_lcevc.h:53
uint16_t custom_resolution_width
Definition cbs_lcevc.h:82
uint8_t resolution_type
Definition cbs_lcevc.h:51
uint8_t enhancement_depth_type
Definition cbs_lcevc.h:55
uint16_t custom_resolution_height
Definition cbs_lcevc.h:83
uint8_t level
Definition svq3.c:208
#define av_mallocz(s)
#define av_freep(p)
#define av_log(a,...)
#define height
Definition dsp.h:89
#define width
Definition dsp.h:89
int size
RefStruct is an API for creating reference-counted objects with minimal overhead.
Definition refstruct.h:58
static enum pl_log_level get_log_level(void)
uint8_t base
Definition vp3data.h:128