Go to the documentation of this file.
23 #include <LCEVC/lcevc_dec.h>
41 return LCEVC_I420_10_LE;
49 return LCEVC_GRAY_10_LE;
52 return LCEVC_ColorFormat_Unknown;
59 return LCEVC_ColorRange_Limited;
61 return LCEVC_ColorRange_Full;
64 return LCEVC_ColorRange_Unknown;
70 case LCEVC_ColorRange_Limited:
72 case LCEVC_ColorRange_Full:
80 LCEVC_PictureHandle *picture)
84 LCEVC_PictureDesc
desc;
92 if (res != LCEVC_Success) {
110 desc.matrixCoefficients = (LCEVC_MatrixCoefficients)in->
colorspace;
111 desc.transferCharacteristics = (LCEVC_TransferCharacteristics)in->
color_trc;
120 if (res != LCEVC_Success) {
132 LCEVC_PictureHandle picture;
134 LCEVC_ReturnCode res;
142 res = LCEVC_SendDecoderEnhancementData(lcevc->
decoder, in->
pts, 0, sd->
data, sd->
size);
143 if (res == LCEVC_Again)
145 else if (res != LCEVC_Success) {
151 res = LCEVC_SendDecoderBase(lcevc->
decoder, in->
pts, 0, picture, -1, in);
152 if (res != LCEVC_Success) {
154 LCEVC_FreePicture(lcevc->
decoder, picture);
162 LCEVC_PictureHandle *picture)
166 LCEVC_PictureDesc
desc;
169 LCEVC_ReturnCode res;
171 res = LCEVC_DefaultPictureDesc(&
desc, fmt,
out->width,
out->height);
172 if (res != LCEVC_Success)
181 if (res != LCEVC_Success) {
182 av_log(
ctx,
AV_LOG_ERROR,
"LCEVC_AllocPictureExternal to allocate a buffer for an enhanced frame\n");
194 LCEVC_PictureDesc
desc;
195 LCEVC_DecodeInformation
info;
196 LCEVC_PictureHandle picture;
197 LCEVC_ReturnCode res;
199 res = LCEVC_ReceiveDecoderPicture(lcevc->
decoder, &picture, &
info);
200 if (res == LCEVC_Again) {
210 }
else if (res != LCEVC_Success) {
220 res = LCEVC_GetPictureDesc(lcevc->
decoder, picture, &
desc);
221 LCEVC_FreePicture(lcevc->
decoder, picture);
224 out->crop_bottom =
desc.cropBottom;
225 out->crop_left =
desc.cropLeft;
226 out->crop_right =
desc.cropRight;
233 out->width = outlink->
w =
desc.width +
out->crop_left +
out->crop_right;
234 out->height = outlink->
h =
desc.height +
out->crop_top +
out->crop_bottom;
239 "hasEnhancement %d, enhanced %d\n",
241 out->crop_top,
out->crop_bottom,
out->crop_left,
out->crop_right,
242 out->sample_aspect_ratio.num,
out->sample_aspect_ratio.den,
243 info.hasEnhancement,
info.enhanced);
252 LCEVC_PictureHandle picture;
253 LCEVC_ReturnCode res;
260 res = LCEVC_SendDecoderPicture(lcevc->
decoder, picture);
261 if (res != LCEVC_Success) {
285 LCEVC_PictureHandle picture;
287 while (LCEVC_ReceiveDecoderBase(lcevc->
decoder, &picture) == LCEVC_Success)
288 LCEVC_FreePicture(lcevc->
decoder, picture);
348 LCEVC_PictureHandle pic,
const LCEVC_DecodeInformation *
info,
349 const uint8_t *
data, uint32_t
size,
void *logctx)
351 if (event != LCEVC_Log)
363 LCEVC_AccelContextHandle
dummy = { 0 };
364 const int32_t event = LCEVC_Log;
365 LCEVC_ReturnCode res;
368 if (res != LCEVC_Success) {
373 res = LCEVC_ConfigureDecoderInt(lcevc->
decoder,
"log_level", 4);
374 if (res != LCEVC_Success) {
378 res = LCEVC_ConfigureDecoderIntArray(lcevc->
decoder,
"events", 1, &event);
379 if (res != LCEVC_Success) {
384 if (res != LCEVC_Success) {
389 res = LCEVC_InitializeDecoder(lcevc->
decoder);
390 if (res != LCEVC_Success) {
402 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.
#define FILTER_PIXFMTS_ARRAY(array)
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.
#define FILTER_INPUTS(array)
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.
static const struct @467 planes[]
#define AV_PIX_FMT_YUV420P10
AVColorPrimaries
Chromaticity coordinates of the source primaries.
const char * name
Filter name.
const AVFilter ff_vf_lcevc
static LCEVC_ColorFormat map_format(int format)
A link between two filters.
@ AV_PIX_FMT_GRAY10LE
Y , 10bpp, little-endian.
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
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_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.
#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.
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
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 format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
static av_cold int init(AVFilterContext *ctx)
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
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)
#define FILTER_OUTPUTS(array)
static int alloc_enhanced_frame(AVFilterLink *inlink, const AVFrame *out, LCEVC_PictureHandle *picture)
static int generate_output(AVFilterLink *inlink, AVFrame *out)
static int activate(AVFilterContext *ctx)
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
static enum AVPixelFormat pix_fmts[]
Rational number (pair of numerator and denominator).
static LCEVC_ColorRange map_range(int range)
@ 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_FRAME_DATA_LCEVC
Raw LCEVC payload data, as a uint8_t array, with NAL emulation bytes intact.
uintptr_t LCEVC_DecoderHandle
static int alloc_base_frame(AVFilterLink *inlink, const AVFrame *in, LCEVC_PictureHandle *picture)
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.
FF_FILTER_FORWARD_WANTED(outlink, inlink)
#define AV_LOG_INFO
Standard information.
#define i(width, name, range_min, range_max)
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...
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
static void flush_bases(AVFilterContext *ctx)
int h
agreed upon image height
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.
static int send_frame(AVFilterLink *inlink, AVFrame *in)