FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_stereo3d.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "stereo3d.h"

Go to the source code of this file.

Data Structures

struct  StereoComponent
 
struct  Stereo3DContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

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

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, ALTERNATING_LR, ALTERNATING_RL,
  CHECKERBOARD_LR, CHECKERBOARD_RL, INTERLEAVE_COLS_LR, INTERLEAVE_COLS_RL,
  HDMI, STEREO_CODE_COUNT
}
 

Functions

 AVFILTER_DEFINE_CLASS (stereo3d)
 
static int query_formats (AVFilterContext *ctx)
 
static uint8_t ana_convert (const int *coeff, const uint8_t *left, const uint8_t *right)
 
static void anaglyph_ic (uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc, ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize, int width, int height, const int *ana_matrix_r, const int *ana_matrix_g, const int *ana_matrix_b)
 
static void anaglyph (uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc, ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize, int width, int height, const int *ana_matrix_r, const int *ana_matrix_g, const int *ana_matrix_b)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static void interleave_cols_to_any (Stereo3DContext *s, int *out_off, int p, AVFrame *in, AVFrame *out, int d)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *inpicref)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const int ana_coeff [][3][6]
 
static const AVOption stereo3d_options []
 
static enum AVPixelFormat anaglyph_pix_fmts []
 
static enum AVPixelFormat other_pix_fmts []
 
static const AVFilterPad stereo3d_inputs []
 
static const AVFilterPad stereo3d_outputs []
 
const AVFilter ff_vf_stereo3d
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 157 of file vf_stereo3d.c.

◆ FLAGS

Definition at line 158 of file vf_stereo3d.c.

Enumeration Type Documentation

◆ StereoCode

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 
ALTERNATING_LR 
ALTERNATING_RL 
CHECKERBOARD_LR 
CHECKERBOARD_RL 
INTERLEAVE_COLS_LR 
INTERLEAVE_COLS_RL 
HDMI 
STEREO_CODE_COUNT 

Definition at line 35 of file vf_stereo3d.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( stereo3d  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 282 of file vf_stereo3d.c.

◆ ana_convert()

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

Definition at line 311 of file vf_stereo3d.c.

Referenced by anaglyph(), and anaglyph_ic().

◆ anaglyph_ic()

static void anaglyph_ic ( uint8_t *  dst,
uint8_t *  lsrc,
uint8_t *  rsrc,
ptrdiff_t  dst_linesize,
ptrdiff_t  l_linesize,
ptrdiff_t  r_linesize,
int  width,
int  height,
const int ana_matrix_r,
const int ana_matrix_g,
const int ana_matrix_b 
)
static

Definition at line 322 of file vf_stereo3d.c.

Referenced by filter_frame().

◆ anaglyph()

static void anaglyph ( uint8_t *  dst,
uint8_t *  lsrc,
uint8_t *  rsrc,
ptrdiff_t  dst_linesize,
ptrdiff_t  l_linesize,
ptrdiff_t  r_linesize,
int  width,
int  height,
const int ana_matrix_r,
const int ana_matrix_g,
const int ana_matrix_b 
)
static

Definition at line 342 of file vf_stereo3d.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 362 of file vf_stereo3d.c.

◆ filter_slice()

static int filter_slice ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 606 of file vf_stereo3d.c.

Referenced by filter_frame().

◆ interleave_cols_to_any()

static void interleave_cols_to_any ( Stereo3DContext s,
int out_off,
int  p,
AVFrame in,
AVFrame out,
int  d 
)
static

Definition at line 630 of file vf_stereo3d.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame inpicref 
)
static

Definition at line 667 of file vf_stereo3d.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 1087 of file vf_stereo3d.c.

Variable Documentation

◆ ana_coeff

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

Definition at line 81 of file vf_stereo3d.c.

Referenced by config_output().

◆ stereo3d_options

const AVOption stereo3d_options[]
static

Definition at line 160 of file vf_stereo3d.c.

◆ anaglyph_pix_fmts

enum AVPixelFormat anaglyph_pix_fmts[]
static
Initial value:

Definition at line 223 of file vf_stereo3d.c.

Referenced by query_formats().

◆ other_pix_fmts

enum AVPixelFormat other_pix_fmts[]
static

Definition at line 228 of file vf_stereo3d.c.

Referenced by query_formats().

◆ stereo3d_inputs

const AVFilterPad stereo3d_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
}

Definition at line 1094 of file vf_stereo3d.c.

◆ stereo3d_outputs

const AVFilterPad stereo3d_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
}

Definition at line 1102 of file vf_stereo3d.c.

◆ ff_vf_stereo3d

const AVFilter ff_vf_stereo3d
Initial value:
= {
.name = "stereo3d",
.description = NULL_IF_CONFIG_SMALL("Convert video stereoscopic 3D view."),
.priv_size = sizeof(Stereo3DContext),
.priv_class = &stereo3d_class,
}

Definition at line 1110 of file vf_stereo3d.c.

filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
Definition: vf_stereo3d.c:667
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_stereo3d.c:362
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:171
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
stereo3d_inputs
static const AVFilterPad stereo3d_inputs[]
Definition: vf_stereo3d.c:1094
Stereo3DContext
Definition: vf_stereo3d.c:140
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:194
stereo3d_outputs
static const AVFilterPad stereo3d_outputs[]
Definition: vf_stereo3d.c:1102
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:68
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:115
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_stereo3d.c:282
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_stereo3d.c:1087
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:117
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:195