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

MP test source, ported from MPlayer libmpcodecs/vf_test.c. More...

#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"
#include "formats.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  MPTestContext
 

Macros

#define WIDTH   512
 
#define HEIGHT   512
 
#define OFFSET(x)   offsetof(MPTestContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  test_type {
  TEST_DC_LUMA, TEST_DC_CHROMA, TEST_FREQ_LUMA, TEST_FREQ_CHROMA,
  TEST_AMP_LUMA, TEST_AMP_CHROMA, TEST_CBP, TEST_MV,
  TEST_RING1, TEST_RING2, TEST_ALL, TEST_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (mptestsrc)
 
static void init_idct (void)
 
static void idct (uint8_t *dst, int dst_linesize, int src[64])
 
static void draw_dc (uint8_t *dst, int dst_linesize, int color, int w, int h)
 
static void draw_basis (uint8_t *dst, int dst_linesize, int amp, int freq, int dc)
 
static void draw_cbp (uint8_t *dst[3], int dst_linesize[3], int cbp, int amp, int dc)
 
static void dc_test (uint8_t *dst, int dst_linesize, int w, int h, int off)
 
static void freq_test (uint8_t *dst, int dst_linesize, int off)
 
static void amp_test (uint8_t *dst, int dst_linesize, int off)
 
static void cbp_test (uint8_t *dst[3], int dst_linesize[3], int off)
 
static void mv_test (uint8_t *dst, int dst_linesize, int off)
 
static void ring1_test (uint8_t *dst, int dst_linesize, int off)
 
static void ring2_test (uint8_t *dst, int dst_linesize, int off)
 
static av_cold int init (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *outlink)
 
static int query_formats (AVFilterContext *ctx)
 
static int request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption mptestsrc_options []
 
static double c [64]
 
static const AVFilterPad mptestsrc_outputs []
 
AVFilter ff_vsrc_mptestsrc
 

Detailed Description

MP test source, ported from MPlayer libmpcodecs/vf_test.c.

Definition in file vsrc_mptestsrc.c.

Macro Definition Documentation

#define WIDTH   512

Definition at line 35 of file vsrc_mptestsrc.c.

Referenced by config_props(), and request_frame().

#define HEIGHT   512

Definition at line 36 of file vsrc_mptestsrc.c.

Referenced by config_props(), and request_frame().

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

Definition at line 61 of file vsrc_mptestsrc.c.

Definition at line 62 of file vsrc_mptestsrc.c.

Enumeration Type Documentation

enum test_type
Enumerator
TEST_DC_LUMA 
TEST_DC_CHROMA 
TEST_FREQ_LUMA 
TEST_FREQ_CHROMA 
TEST_AMP_LUMA 
TEST_AMP_CHROMA 
TEST_CBP 
TEST_MV 
TEST_RING1 
TEST_RING2 
TEST_ALL 
TEST_NB 

Definition at line 38 of file vsrc_mptestsrc.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( mptestsrc  )
static void init_idct ( void  )
static

Definition at line 89 of file vsrc_mptestsrc.c.

Referenced by init().

static void idct ( uint8_t dst,
int  dst_linesize,
int  src[64] 
)
static

Definition at line 101 of file vsrc_mptestsrc.c.

Referenced by draw_basis().

static void draw_dc ( uint8_t dst,
int  dst_linesize,
int  color,
int  w,
int  h 
)
static

Definition at line 129 of file vsrc_mptestsrc.c.

Referenced by dc_test(), and ring1_test().

static void draw_basis ( uint8_t dst,
int  dst_linesize,
int  amp,
int  freq,
int  dc 
)
static

Definition at line 138 of file vsrc_mptestsrc.c.

Referenced by amp_test(), draw_cbp(), and freq_test().

static void draw_cbp ( uint8_t dst[3],
int  dst_linesize[3],
int  cbp,
int  amp,
int  dc 
)
static

Definition at line 149 of file vsrc_mptestsrc.c.

Referenced by cbp_test().

static void dc_test ( uint8_t dst,
int  dst_linesize,
int  w,
int  h,
int  off 
)
static

Definition at line 159 of file vsrc_mptestsrc.c.

Referenced by request_frame().

static void freq_test ( uint8_t dst,
int  dst_linesize,
int  off 
)
static

Definition at line 172 of file vsrc_mptestsrc.c.

Referenced by request_frame().

static void amp_test ( uint8_t dst,
int  dst_linesize,
int  off 
)
static

Definition at line 184 of file vsrc_mptestsrc.c.

Referenced by request_frame().

static void cbp_test ( uint8_t dst[3],
int  dst_linesize[3],
int  off 
)
static

Definition at line 196 of file vsrc_mptestsrc.c.

Referenced by request_frame().

static void mv_test ( uint8_t dst,
int  dst_linesize,
int  off 
)
static

Definition at line 213 of file vsrc_mptestsrc.c.

Referenced by request_frame().

static void ring1_test ( uint8_t dst,
int  dst_linesize,
int  off 
)
static

Definition at line 225 of file vsrc_mptestsrc.c.

Referenced by request_frame().

static void ring2_test ( uint8_t dst,
int  dst_linesize,
int  off 
)
static

Definition at line 237 of file vsrc_mptestsrc.c.

Referenced by request_frame().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 256 of file vsrc_mptestsrc.c.

static int config_props ( AVFilterLink outlink)
static

Definition at line 272 of file vsrc_mptestsrc.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 288 of file vsrc_mptestsrc.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 300 of file vsrc_mptestsrc.c.

Variable Documentation

const AVOption mptestsrc_options[]
static
Initial value:
= {
{ "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, FLAGS },
{ "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, FLAGS },
{ "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },
{ "d", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },
{ "test", "set test to perform", OFFSET(test), AV_OPT_TYPE_INT, {.i64=TEST_ALL}, 0, INT_MAX, FLAGS, "test" },
{ "t", "set test to perform", OFFSET(test), AV_OPT_TYPE_INT, {.i64=TEST_ALL}, 0, INT_MAX, FLAGS, "test" },
{ "dc_luma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_DC_LUMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "dc_chroma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_DC_CHROMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "freq_luma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_FREQ_LUMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "freq_chroma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_FREQ_CHROMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "amp_luma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_AMP_LUMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "amp_chroma", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_AMP_CHROMA}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "cbp", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_CBP}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "mv", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_MV}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "ring1", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_RING1}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "ring2", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_RING2}, INT_MIN, INT_MAX, FLAGS, "test" },
{ "all", "", 0, AV_OPT_TYPE_CONST, {.i64=TEST_ALL}, INT_MIN, INT_MAX, FLAGS, "test" },
{ NULL }
}
#define NULL
Definition: coverity.c:32
int64_t duration
Definition: movenc.c:63
#define OFFSET(x)
static void test(const char *pattern, const char *host)
Definition: noproxy.c:23
offset must point to AVRational
Definition: opt.h:236
#define FLAGS

Definition at line 63 of file vsrc_mptestsrc.c.

double c[64]
static

Definition at line 87 of file vsrc_mptestsrc.c.

Referenced by idct(), and init_idct().

const AVFilterPad mptestsrc_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_props,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_props(AVFilterLink *outlink)
static int request_frame(AVFilterLink *outlink)

Definition at line 344 of file vsrc_mptestsrc.c.

AVFilter ff_vsrc_mptestsrc
Initial value:
= {
.name = "mptestsrc",
.description = NULL_IF_CONFIG_SMALL("Generate various test pattern."),
.priv_size = sizeof(MPTestContext),
.priv_class = &mptestsrc_class,
.init = init,
}
#define NULL
Definition: coverity.c:32
static av_cold int init(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const AVFilterPad mptestsrc_outputs[]
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
static int query_formats(AVFilterContext *ctx)

Definition at line 354 of file vsrc_mptestsrc.c.