FFmpeg
Classes | Macros | Typedefs | Functions | Variables
vf_xbr.c File Reference

XBR Filter is used for depixelization of image. More...

#include "libavutil/opt.h"
#include "libavutil/avassert.h"
#include "libavutil/pixdesc.h"
#include "internal.h"

Classes

struct  XBRContext
 
struct  ThreadData
 

Macros

#define LB_MASK   0x00FEFEFE
 
#define RED_BLUE_MASK   0x00FF00FF
 
#define GREEN_MASK   0x0000FF00
 
#define OFFSET(x)   offsetof(XBRContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define YMASK   0xff0000
 
#define UMASK   0x00ff00
 
#define VMASK   0x0000ff
 
#define ABSDIFF(a, b)   (abs((int)(a)-(int)(b)))
 
#define ALPHA_BLEND_128_W(a, b)   ((((a) & LB_MASK) >> 1) + (((b) & LB_MASK) >> 1))
 
#define ALPHA_BLEND_BASE(a, b, m, s)
 
#define ALPHA_BLEND_32_W(a, b)   ALPHA_BLEND_BASE(a, b, 1, 3)
 
#define ALPHA_BLEND_64_W(a, b)   ALPHA_BLEND_BASE(a, b, 1, 2)
 
#define ALPHA_BLEND_192_W(a, b)   ALPHA_BLEND_BASE(a, b, 3, 2)
 
#define ALPHA_BLEND_224_W(a, b)   ALPHA_BLEND_BASE(a, b, 7, 3)
 
#define df(A, B)   pixel_diff(A, B, r2y)
 
#define eq(A, B)   (df(A, B) < 155)
 
#define FILT2(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N0, N1, N2, N3)
 
#define FILT3(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N0, N1, N2, N3, N4, N5, N6, N7, N8)
 
#define FILT4(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, N15, N14, N11, N3, N7, N10, N13, N12, N9, N6, N2, N1, N5, N8, N4, N0)
 
#define XBR_FUNC(size)
 

Typedefs

typedef int(* xbrfunc_t) (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
typedef struct XBRContext XBRContext
 
typedef struct ThreadData ThreadData
 

Functions

 AVFILTER_DEFINE_CLASS (xbr)
 

Variables

AVFilter ff_vf_xbr
 

Detailed Description

XBR Filter is used for depixelization of image.

This is based on Hyllian's xBR shader.

See also
http://www.libretro.com/forums/viewtopic.php?f=6&t=134
https://github.com/yoyofr/iFBA/blob/master/fba_src/src/intf/video/scalers/xbr.cpp

Macro Definition Documentation

§ ALPHA_BLEND_BASE

#define ALPHA_BLEND_BASE (   a,
  b,
  m,
 
)
Value:
( (RED_BLUE_MASK & (((a) & RED_BLUE_MASK) + (((((b) & RED_BLUE_MASK) - ((a) & RED_BLUE_MASK)) * (m)) >> (s)))) \
| (GREEN_MASK & (((a) & GREEN_MASK) + (((((b) & GREEN_MASK) - ((a) & GREEN_MASK)) * (m)) >> (s)))))

§ XBR_FUNC

#define XBR_FUNC (   size)
Value:
static int xbr##size##x(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) \
{ \
xbr_filter(arg, jobnr, nb_jobs, size); \
return 0; \
}
An instance of a filter.
Definition: avfilter.h:338

Variable Documentation

§ ff_vf_xbr

AVFilter ff_vf_xbr
Initial value:
= {
.name = "xbr",
.description = NULL_IF_CONFIG_SMALL("Scale the input using xBR algorithm."),
.inputs = xbr_inputs,
.outputs = xbr_outputs,
.query_formats = query_formats,
.priv_size = sizeof(XBRContext),
.priv_class = &xbr_class,
.init = init,
}
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
Definition: vf_xbr.c:46