FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_framepack.c File Reference

Generate a frame packed video, by combining two views in a single surface. More...

#include <string.h>
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/rational.h"
#include "libavutil/stereo3d.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  FramepackContext
 

Macros

#define LEFT   0
 
#define RIGHT   1
 
#define OFFSET(x)   offsetof(FramepackContext, x)
 
#define V   AV_OPT_FLAG_VIDEO_PARAM
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static av_cold void framepack_uninit (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static void horizontal_frame_pack (FramepackContext *s, AVFrame *dst, int interleaved)
 
static void vertical_frame_pack (FramepackContext *s, AVFrame *dst, int interleaved)
 
static av_always_inline void spatial_frame_pack (FramepackContext *s, AVFrame *dst)
 
static int filter_frame_left (AVFilterLink *inlink, AVFrame *frame)
 
static int filter_frame_right (AVFilterLink *inlink, AVFrame *frame)
 
static int request_frame (AVFilterLink *outlink)
 

Variables

static enum AVPixelFormat formats_supported []
 
static const AVOption options []
 
static const AVClass framepack_class
 
static const AVFilterPad framepack_inputs []
 
static const AVFilterPad framepack_outputs []
 
AVFilter ff_vf_framepack
 

Detailed Description

Generate a frame packed video, by combining two views in a single surface.

Definition in file vf_framepack.c.

Macro Definition Documentation

#define LEFT   0
#define RIGHT   1
#define OFFSET (   x)    offsetof(FramepackContext, x)

Definition at line 316 of file vf_framepack.c.

#define V   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 317 of file vf_framepack.c.

Function Documentation

static int query_formats ( AVFilterContext ctx)
static

Definition at line 61 of file vf_framepack.c.

static av_cold void framepack_uninit ( AVFilterContext ctx)
static

Definition at line 70 of file vf_framepack.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 79 of file vf_framepack.c.

static void horizontal_frame_pack ( FramepackContext s,
AVFrame dst,
int  interleaved 
)
static

Definition at line 146 of file vf_framepack.c.

Referenced by spatial_frame_pack().

static void vertical_frame_pack ( FramepackContext s,
AVFrame dst,
int  interleaved 
)
static

Definition at line 189 of file vf_framepack.c.

Referenced by spatial_frame_pack().

static av_always_inline void spatial_frame_pack ( FramepackContext s,
AVFrame dst 
)
static

Definition at line 218 of file vf_framepack.c.

Referenced by request_frame().

static int filter_frame_left ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 236 of file vf_framepack.c.

static int filter_frame_right ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 243 of file vf_framepack.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 250 of file vf_framepack.c.

Variable Documentation

enum AVPixelFormat formats_supported[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:68
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:103
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:102
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:76
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:67
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:75
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:69
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:63
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:77

Definition at line 54 of file vf_framepack.c.

Referenced by query_formats().

const AVOption options[]
static
Initial value:
= {
{ "format", "Frame pack output format", OFFSET(format), AV_OPT_TYPE_INT,
{ .i64 = AV_STEREO3D_SIDEBYSIDE }, 0, INT_MAX, .flags = V, .unit = "format" },
{ "sbs", "Views are packed next to each other", 0, AV_OPT_TYPE_CONST,
{ .i64 = AV_STEREO3D_SIDEBYSIDE }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
{ "tab", "Views are packed on top of each other", 0, AV_OPT_TYPE_CONST,
{ .i64 = AV_STEREO3D_TOPBOTTOM }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
{ "frameseq", "Views are one after the other", 0, AV_OPT_TYPE_CONST,
{ .i64 = AV_STEREO3D_FRAMESEQUENCE }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
{ "lines", "Views are interleaved by lines", 0, AV_OPT_TYPE_CONST,
{ .i64 = AV_STEREO3D_LINES }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
{ "columns", "Views are interleaved by columns", 0, AV_OPT_TYPE_CONST,
{ .i64 = AV_STEREO3D_COLUMNS }, INT_MIN, INT_MAX, .flags = V, .unit = "format" },
{ NULL },
}
#define NULL
Definition: coverity.c:32
Views are packed per line, as if interlaced.
Definition: stereo3d.h:97
Views are alternated temporally.
Definition: stereo3d.h:66
#define OFFSET(x)
Definition: vf_framepack.c:316
#define V
Definition: vf_framepack.c:317
Views are on top of each other.
Definition: stereo3d.h:55
Views are next to each other.
Definition: stereo3d.h:45
Views are packed per column.
Definition: stereo3d.h:107

Definition at line 318 of file vf_framepack.c.

const AVClass framepack_class
static
Initial value:
= {
.class_name = "framepack",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:62
static const AVOption options[]
Definition: vf_framepack.c:318
av_default_item_name

Definition at line 334 of file vf_framepack.c.

const AVFilterPad framepack_inputs[]
static
Initial value:
= {
{
.name = "left",
.filter_frame = filter_frame_left,
.needs_fifo = 1,
},
{
.name = "right",
.filter_frame = filter_frame_right,
.needs_fifo = 1,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame_right(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_framepack.c:243
static int filter_frame_left(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_framepack.c:236

Definition at line 341 of file vf_framepack.c.

const AVFilterPad framepack_outputs[]
static
Initial value:
= {
{
.name = "packed",
.config_props = config_output,
.request_frame = request_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)
Definition: vf_framepack.c:250
static int config_output(AVFilterLink *outlink)
Definition: vf_framepack.c:79

Definition at line 357 of file vf_framepack.c.

AVFilter ff_vf_framepack
Initial value:
= {
.name = "framepack",
.description = NULL_IF_CONFIG_SMALL("Generate a frame packed stereoscopic video."),
.priv_size = sizeof(FramepackContext),
.priv_class = &framepack_class,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:248
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:337
static int query_formats(AVFilterContext *ctx)
Definition: vf_framepack.c:61
static const AVClass framepack_class
Definition: vf_framepack.c:334
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:239
static const AVFilterPad framepack_inputs[]
Definition: vf_framepack.c:341
static av_cold void framepack_uninit(AVFilterContext *ctx)
Definition: vf_framepack.c:70
static const AVFilterPad framepack_outputs[]
Definition: vf_framepack.c:357

Definition at line 367 of file vf_framepack.c.