114 "Left and right sizes differ (%dx%d vs %dx%d).\n",
120 "Left and right time bases differ (%d/%d vs %d/%d).\n",
121 time_base.
num, time_base.
den,
127 "Left and right framerates differ (%d/%d vs %d/%d).\n",
128 frame_rate.
num, frame_rate.
den,
174 if (interleaved && s->
depth <= 8) {
182 if (plane == 1 || plane == 2) {
186 for (i = 0; i < lines; i++) {
193 for (j = 0; j <
length; j++) {
197 (plane == 1 || plane == 2)) {
198 *dstp++ = (*leftp + *rightp) / 2;
199 *dstp++ = (*leftp + *rightp) / 2;
209 }
else if (interleaved && s->
depth > 8) {
212 uint16_t *dstp = (uint16_t *)out->
data[0];
217 if (plane == 1 || plane == 2) {
221 for (i = 0; i < lines; i++) {
227 dstp = (uint16_t *)out->
data[plane] + out->
linesize[plane] * i / 2;
232 (plane == 1 || plane == 2)) {
233 *dstp++ = (*leftp + *rightp) / 2;
234 *dstp++ = (*leftp + *rightp) / 2;
245 for (i = 0; i < 2; i++) {
246 const int psize = 1 + (s->
depth > 8);
256 dst[1] = out->
data[1] + i * sub_w;
257 dst[2] = out->
data[2] + i * sub_w;
275 for (i = 0; i < 2; i++) {
288 (interleaved + sub_h * (1 - interleaved));
290 (interleaved + sub_h * (1 - interleaved));
339 for (i = 0; i < 2; i++) {
373 for (i = 0; i < 2; i++)
431 #define OFFSET(x) offsetof(FramepackContext, x) 432 #define VF AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM 476 .priv_class = &framepack_class,
478 .
inputs = framepack_inputs,
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
#define AV_PIX_FMT_YUVA422P16
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_PIX_FMT_YUV440P10
#define AV_PIX_FMT_YUVA422P9
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
#define AV_PIX_FMT_YUVA420P10
enum AVStereo3DView view
Determines which views are packed.
#define AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_YUVA422P10
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, filter)
Forward the status on an output link to all input links.
Main libavfilter public API header.
int h
agreed upon image height
FF_FILTER_FORWARD_STATUS(inlink, outlink)
static int try_push_frame(AVFilterContext *ctx)
Frame contains only the right view.
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_YUV420P12
static enum AVPixelFormat formats_supported[]
Views are next to each other.
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
static void vertical_frame_pack(AVFilterLink *outlink, AVFrame *out, int interleaved)
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
Frame contains only the left view.
#define AV_PIX_FMT_GRAY10
const char * name
Pad name.
#define AV_PIX_FMT_GRAY12
AVFilterLink ** inputs
array of pointers to input links
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
AVFILTER_DEFINE_CLASS(framepack)
static av_cold int uninit(AVCodecContext *avctx)
Stereo 3D type: this structure describes how two videos are packed within a single video surface...
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define AV_PIX_FMT_YUVA420P9
static int query_formats(AVFilterContext *ctx)
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
#define AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUVA420P16
the definition of that something depends on the semantic of the filter The callback must examine the status of the filter s links and proceed accordingly The status of output links is stored in the status_in and status_out fields and tested by the ff_outlink_frame_wanted() function.If this function returns true
static void horizontal_frame_pack(AVFilterLink *outlink, AVFrame *out, int interleaved)
A filter pad used for either input or output.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
A link between two filters.
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0, will be automatically copied from the first input of the source filter if it exists.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Views are packed per line, as if interlaced.
void * priv
private data for use by the filter
#define AV_PIX_FMT_YUVA444P16
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
#define AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_YUV444P10
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], const uint8_t *src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height)
Copy image in src_data to dst_data.
#define AV_PIX_FMT_GBRAP16
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
AVStereo3D * av_stereo3d_create_side_data(AVFrame *frame)
Allocate a complete AVFrameSideData and add it to the frame.
int w
agreed upon image width
Views are alternated temporally.
#define AV_PIX_FMT_YUV422P9
uint8_t nb_components
The number of components each pixel has, (1-4)
#define AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GRAY16
AVStereo3DType
List of possible 3D Types.
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
#define AV_PIX_FMT_YUVA444P12
AVFrame * input_views[2]
input frames
AVFilterContext * src
source filter
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_GBRP14
static const AVFilterPad outputs[]
int format
agreed upon media format
#define AV_PIX_FMT_YUV420P16
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
enum AVStereo3DType type
How views are packed within the video.
#define AV_PIX_FMT_YUV420P14
Views are on top of each other.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define AV_PIX_FMT_GRAY14
enum AVStereo3DType format
frame pack type output
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 inputs
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
#define AV_PIX_FMT_YUV420P10
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Describe the class of an AVClass context structure.
int ff_outlink_get_status(AVFilterLink *link)
Get the status on an output link.
Rational number (pair of numerator and denominator).
static const AVFilterPad framepack_inputs[]
const char * name
Filter name.
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV420P9
AVFilterLink ** outputs
array of pointers to output links
const AVPixFmtDescriptor * pix_desc
agreed pixel format
#define AV_PIX_FMT_YUV422P14
static int activate(AVFilterContext *ctx)
#define AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_YUV422P10
static int config_output(AVFilterLink *outlink)
#define AV_PIX_FMT_YUV444P12
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static av_cold void framepack_uninit(AVFilterContext *ctx)
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal and external API header
Utilties for rational number calculation.
planar GBRA 4:4:4:4 32bpp
#define AV_PIX_FMT_YUVA444P9
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Views are packed per column.
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
static const AVOption framepack_options[]
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
static const AVFilterPad framepack_outputs[]
static av_always_inline void spatial_frame_pack(AVFilterLink *outlink, AVFrame *dst)
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
int depth
Number of bits in the component.
AVPixelFormat
Pixel format.
#define AV_PIX_FMT_YUV422P16
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define AV_PIX_FMT_YUVA422P12
#define AV_CEIL_RSHIFT(a, b)