Go to the documentation of this file.
23 #include <LCEVC/lcevc_dec.h>
41 return LCEVC_I420_10_LE;
43 return LCEVC_I420_12_LE;
47 return LCEVC_I422_10_LE;
49 return LCEVC_I422_12_LE;
53 return LCEVC_I444_10_LE;
55 return LCEVC_I444_12_LE;
63 return LCEVC_GRAY_10_LE;
65 return LCEVC_GRAY_12_LE;
68 return LCEVC_ColorFormat_Unknown;
75 return LCEVC_ColorRange_Limited;
77 return LCEVC_ColorRange_Full;
80 return LCEVC_ColorRange_Unknown;
86 case LCEVC_ColorRange_Limited:
88 case LCEVC_ColorRange_Full:
96 LCEVC_PictureHandle *picture)
100 LCEVC_PictureDesc
desc;
105 LCEVC_ReturnCode res;
108 if (res != LCEVC_Success) {
126 desc.matrixCoefficients = (LCEVC_MatrixCoefficients)in->
colorspace;
127 desc.transferCharacteristics = (LCEVC_TransferCharacteristics)in->
color_trc;
136 if (res != LCEVC_Success) {
148 LCEVC_PictureHandle picture;
150 LCEVC_ReturnCode res;
159 if (res == LCEVC_Again)
161 else if (res != LCEVC_Success) {
167 res = LCEVC_SetPictureUserData(lcevc->
decoder, picture, in);
168 if (res != LCEVC_Success) {
170 LCEVC_FreePicture(lcevc->
decoder, picture);
174 res = LCEVC_SendDecoderBase(lcevc->
decoder, in->
pts, picture, -1, in);
175 if (res != LCEVC_Success) {
177 LCEVC_FreePicture(lcevc->
decoder, picture);
185 LCEVC_PictureHandle *picture)
189 LCEVC_PictureDesc
desc;
192 LCEVC_ReturnCode res;
194 res = LCEVC_DefaultPictureDesc(&
desc, fmt,
out->width,
out->height);
195 if (res != LCEVC_Success)
204 if (res != LCEVC_Success) {
205 av_log(
ctx,
AV_LOG_ERROR,
"LCEVC_AllocPictureExternal to allocate a buffer for an enhanced frame\n");
217 LCEVC_PictureDesc
desc;
218 LCEVC_DecodeInformation
info;
219 LCEVC_PictureHandle picture;
220 LCEVC_ReturnCode res;
222 res = LCEVC_ReceiveDecoderPicture(lcevc->
decoder, &picture, &
info);
223 if (res == LCEVC_Again) {
233 }
else if (res != LCEVC_Success) {
241 res = LCEVC_GetPictureDesc(lcevc->
decoder, picture, &
desc);
242 LCEVC_FreePicture(lcevc->
decoder, picture);
245 out->crop_bottom =
desc.cropBottom;
246 out->crop_left =
desc.cropLeft;
247 out->crop_right =
desc.cropRight;
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;
260 "hasEnhancement %d, enhanced %d\n",
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);
273 LCEVC_PictureHandle picture;
274 LCEVC_ReturnCode res;
281 res = LCEVC_SendDecoderPicture(lcevc->
decoder, picture);
282 if (res != LCEVC_Success) {
296 outlink->
w = lcevc->
w =
inlink->w * 2;
297 outlink->
h = lcevc->
h =
inlink->h * 2;
306 LCEVC_PictureHandle picture;
308 while (LCEVC_ReceiveDecoderBase(lcevc->
decoder, &picture) == LCEVC_Success) {
310 LCEVC_GetPictureUserData(lcevc->
decoder, picture, (
void **)&
base);
311 LCEVC_FreePicture(lcevc->
decoder, picture);
373 LCEVC_PictureHandle pic,
const LCEVC_DecodeInformation *
info,
374 const uint8_t *
data, uint32_t
size,
void *logctx)
376 if (event != LCEVC_Log)
388 LCEVC_AccelContextHandle
dummy = { 0 };
389 const int32_t event = LCEVC_Log;
390 LCEVC_ReturnCode res;
393 if (res != LCEVC_Success) {
398 res = LCEVC_ConfigureDecoderInt(lcevc->
decoder,
"log_level", 4);
399 if (res != LCEVC_Success) {
403 res = LCEVC_ConfigureDecoderIntArray(lcevc->
decoder,
"events", 1, &event);
404 if (res != LCEVC_Success) {
409 if (res != LCEVC_Success) {
414 res = LCEVC_InitializeDecoder(lcevc->
decoder);
415 if (res != LCEVC_Success) {
427 LCEVC_FlushDecoder(lcevc->
decoder);
429 LCEVC_DestroyDecoder(lcevc->
decoder);
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
enum AVColorTransferCharacteristic color_trc
enum AVColorRange color_range
MPEG vs JPEG YUV range.
AVPixelFormat
Pixel format.
static int config_props(AVFilterLink *outlink)
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
AVColorTransferCharacteristic
Color Transfer Characteristic.
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static av_cold void uninit(AVFilterContext *ctx)
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
#define AV_VIDEO_MAX_PLANES
Maximum number of planes in any pixel format.
enum AVColorPrimaries color_primaries
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
enum AVColorSpace colorspace
YUV colorspace type.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PIX_FMT_YUV420P10
AVColorPrimaries
Chromaticity coordinates of the source primaries.
const char * name
Filter name.
static LCEVC_ColorFormat map_format(int format)
A link between two filters.
@ AV_PIX_FMT_GRAY10LE
Y , 10bpp, little-endian.
static const AVFilterPad lcevc_outputs[]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
#define FILTER_PIXFMTS_ARRAY(array)
@ AV_PIX_FMT_YUV420P10LE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
A filter pad used for either input or output.
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
#define AV_PIX_FMT_YUV444P10
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
#define FILTER_OUTPUTS(array)
static av_cold int init(AVFilterContext *ctx)
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static AVFormatContext * ctx
static int receive_frame(AVFilterLink *inlink, AVFrame *out)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int alloc_enhanced_frame(AVFilterLink *inlink, const AVFrame *out, LCEVC_PictureHandle *picture)
static int generate_output(AVFilterLink *inlink, AVFrame *out)
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
static int activate(AVFilterContext *ctx)
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
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
static enum AVPixelFormat pix_fmts[]
Rational number (pair of numerator and denominator).
static LCEVC_ColorRange map_range(int range)
#define AV_PIX_FMT_YUV422P10
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
@ AVCOL_RANGE_UNSPECIFIED
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ AV_PIX_FMT_YUV422P10LE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
#define i(width, name, range_min, range_max)
#define AV_PIX_FMT_YUV422P12
@ AV_FRAME_DATA_LCEVC
Raw LCEVC payload data, as a uint8_t array, with NAL emulation bytes intact.
uintptr_t LCEVC_DecoderHandle
@ AV_PIX_FMT_GRAY12LE
Y , 12bpp, little-endian.
static int alloc_base_frame(AVFilterLink *inlink, const AVFrame *in, LCEVC_PictureHandle *picture)
#define AV_PIX_FMT_YUV444P12
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
AVFilterContext * src
source filter
void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
Remove and free all side data instances of the given type.
#define AVERROR_EXTERNAL
Generic error in an external library.
static const struct @585 planes[]
FF_FILTER_FORWARD_WANTED(outlink, inlink)
#define AV_LOG_INFO
Standard information.
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)
int w
agreed upon image width
AVColorSpace
YUV colorspace type.
LCEVC_DecoderHandle decoder
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
const char * name
Pad name.
static enum AVColorRange map_av_range(int range)
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ 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...
#define FILTER_INPUTS(array)
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
#define AV_PIX_FMT_YUV420P12
static void flush_bases(AVFilterContext *ctx)
int h
agreed upon image height
const FFFilter ff_vf_lcevc
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
AVFilter p
The public AVFilter.
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Structure to hold side data for an AVFrame.
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
AVColorRange
Visual content value range.
@ AV_PIX_FMT_YUV422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
static int send_frame(AVFilterLink *inlink, AVFrame *in)