vf_stereo3d.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
Include dependency graph for vf_stereo3d.c:

Go to the source code of this file.

Data Structures

struct  StereoComponent
 
struct  Stereo3DContext
 

Macros

#define OFFSET(x)   offsetof(Stereo3DContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Typedefs

typedef struct StereoComponent StereoComponent
 
typedef struct Stereo3DContext Stereo3DContext
 

Enumerations

enum  StereoCode {
  ANAGLYPH_RC_GRAY, ANAGLYPH_RC_HALF, ANAGLYPH_RC_COLOR, ANAGLYPH_RC_DUBOIS,
  ANAGLYPH_GM_GRAY, ANAGLYPH_GM_HALF, ANAGLYPH_GM_COLOR, ANAGLYPH_GM_DUBOIS,
  ANAGLYPH_YB_GRAY, ANAGLYPH_YB_HALF, ANAGLYPH_YB_COLOR, ANAGLYPH_YB_DUBOIS,
  ANAGLYPH_RB_GRAY, ANAGLYPH_RG_GRAY, MONO_L, MONO_R,
  INTERLEAVE_ROWS_LR, INTERLEAVE_ROWS_RL, SIDE_BY_SIDE_LR, SIDE_BY_SIDE_RL,
  SIDE_BY_SIDE_2_LR, SIDE_BY_SIDE_2_RL, ABOVE_BELOW_LR, ABOVE_BELOW_RL,
  ABOVE_BELOW_2_LR, ABOVE_BELOW_2_RL, STEREO_CODE_COUNT
}
 

Functions

 AVFILTER_DEFINE_CLASS (stereo3d)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static uint8_t ana_convert (const int *coeff, uint8_t *left, uint8_t *right)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *inpicref)
 

Variables

static const int ana_coeff [][3][6]
 
static const AVOption stereo3d_options []
 
static enum AVPixelFormat anaglyph_pix_fmts [] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE }
 
static enum AVPixelFormat other_pix_fmts []
 
static const AVFilterPad stereo3d_inputs []
 
static const AVFilterPad stereo3d_outputs []
 
AVFilter avfilter_vf_stereo3d
 

Macro Definition Documentation

Definition at line 141 of file vf_stereo3d.c.

#define OFFSET (   x)    offsetof(Stereo3DContext, x)

Definition at line 140 of file vf_stereo3d.c.

Typedef Documentation

Enumeration Type Documentation

enum StereoCode
Enumerator
ANAGLYPH_RC_GRAY 
ANAGLYPH_RC_HALF 
ANAGLYPH_RC_COLOR 
ANAGLYPH_RC_DUBOIS 
ANAGLYPH_GM_GRAY 
ANAGLYPH_GM_HALF 
ANAGLYPH_GM_COLOR 
ANAGLYPH_GM_DUBOIS 
ANAGLYPH_YB_GRAY 
ANAGLYPH_YB_HALF 
ANAGLYPH_YB_COLOR 
ANAGLYPH_YB_DUBOIS 
ANAGLYPH_RB_GRAY 
ANAGLYPH_RG_GRAY 
MONO_L 
MONO_R 
INTERLEAVE_ROWS_LR 
INTERLEAVE_ROWS_RL 
SIDE_BY_SIDE_LR 
SIDE_BY_SIDE_RL 
SIDE_BY_SIDE_2_LR 
SIDE_BY_SIDE_2_RL 
ABOVE_BELOW_LR 
ABOVE_BELOW_RL 
ABOVE_BELOW_2_LR 
ABOVE_BELOW_2_RL 
STEREO_CODE_COUNT 

Definition at line 32 of file vf_stereo3d.c.

Function Documentation

static uint8_t ana_convert ( const int *  coeff,
uint8_t left,
uint8_t right 
)
inlinestatic

Definition at line 409 of file vf_stereo3d.c.

Referenced by filter_frame().

AVFILTER_DEFINE_CLASS ( stereo3d  )
static int config_output ( AVFilterLink outlink)
static

Definition at line 246 of file vf_stereo3d.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame inpicref 
)
static

Definition at line 420 of file vf_stereo3d.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 215 of file vf_stereo3d.c.

Variable Documentation

const int ana_coeff[][3][6]
static

Definition at line 70 of file vf_stereo3d.c.

Referenced by config_output().

enum AVPixelFormat anaglyph_pix_fmts[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE }
static

Definition at line 185 of file vf_stereo3d.c.

Referenced by query_formats().

AVFilter avfilter_vf_stereo3d
Initial value:
= {
.name = "stereo3d",
.description = NULL_IF_CONFIG_SMALL("Convert video stereoscopic 3D view."),
.priv_size = sizeof(Stereo3DContext),
.priv_class = &stereo3d_class,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
struct Stereo3DContext Stereo3DContext
static const AVFilterPad stereo3d_outputs[]
Definition: vf_stereo3d.c:529
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static const AVFilterPad stereo3d_inputs[]
Definition: vf_stereo3d.c:520
static int query_formats(AVFilterContext *ctx)
Definition: vf_stereo3d.c:215
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

Definition at line 538 of file vf_stereo3d.c.

enum AVPixelFormat other_pix_fmts[]
static
Initial value:
= {
}
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:231
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:212
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:73
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:70
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:154
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:229
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:211
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:195
planar GBR 4:4:4 36bpp, little-endian
Definition: pixfmt.h:234
packed BGR 8:8:8, 32bpp, 0BGR0BGR...
Definition: pixfmt.h:216
planar GBR 4:4:4 36bpp, big-endian
Definition: pixfmt.h:233
packed RGB 8:8:8, 32bpp, RGB0RGB0...
Definition: pixfmt.h:215
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:112
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:209
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:230
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:98
planar GBR 4:4:4 48bpp, big-endian
Definition: pixfmt.h:173
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:200
planar GBR 4:4:4 27bpp, big-endian
Definition: pixfmt.h:169
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:157
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:133
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:99
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
Definition: pixfmt.h:188
planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
Definition: pixfmt.h:189
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:96
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:143
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:97
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
Definition: pixfmt.h:194
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:71
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:142
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:218
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:171
planar GBR 4:4:4 42bpp, little-endian
Definition: pixfmt.h:236
planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:201
packed BGR 8:8:8, 32bpp, BGR0BGR0...
Definition: pixfmt.h:217
planar GBR 4:4:4 42bpp, big-endian
Definition: pixfmt.h:235
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:155
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:132
planar GBR 4:4:4 27bpp, little-endian
Definition: pixfmt.h:170
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:111
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
Definition: pixfmt.h:82
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:232
planar GBR 4:4:4 48bpp, little-endian
Definition: pixfmt.h:174
packed RGB 8:8:8, 32bpp, 0RGB0RGB...
Definition: pixfmt.h:214
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:156
planar GBR 4:4:4 30bpp, little-endian
Definition: pixfmt.h:172
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:210

Definition at line 186 of file vf_stereo3d.c.

Referenced by query_formats().

const AVFilterPad stereo3d_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
NULL
Definition: eval.c:55
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
Definition: vf_stereo3d.c:420

Definition at line 520 of file vf_stereo3d.c.

const AVOption stereo3d_options[]
static

Definition at line 143 of file vf_stereo3d.c.

const AVFilterPad stereo3d_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
NULL
Definition: eval.c:55
static int config_output(AVFilterLink *outlink)
Definition: vf_stereo3d.c:246

Definition at line 529 of file vf_stereo3d.c.