FFmpeg
|
Pixel remap filter This filter copies pixel by pixel a source frame to a target frame. More...
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
Go to the source code of this file.
Data Structures | |
struct | RemapContext |
struct | ThreadData |
Used for passing data between threads. More... | |
Macros | |
#define | OFFSET(x) offsetof(RemapContext, x) |
#define | FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
#define | DEFINE_REMAP_PLANAR_FUNC(name, bits, div) |
remap_planar algorithm expects planes of same size pixels are copied from source to target using : Target_frame[y][x] = Source_frame[ ymap[y][x] ][ [xmap[y][x] ]; More... | |
#define | DEFINE_REMAP_PACKED_FUNC(name, bits, div) |
remap_packed algorithm expects pixels with both padded bits (step) and number of components correctly set. More... | |
Functions | |
AVFILTER_DEFINE_CLASS (remap) | |
static int | query_formats (AVFilterContext *ctx) |
static int | config_input (AVFilterLink *inlink) |
static int | process_frame (FFFrameSync *fs) |
static int | config_output (AVFilterLink *outlink) |
static int | activate (AVFilterContext *ctx) |
static av_cold void | uninit (AVFilterContext *ctx) |
Variables | |
static const AVOption | remap_options [] |
static const AVFilterPad | remap_inputs [] |
static const AVFilterPad | remap_outputs [] |
AVFilter | ff_vf_remap |
Pixel remap filter This filter copies pixel by pixel a source frame to a target frame.
It remaps the pixels to a new x,y destination based on two files ymap/xmap. Map files are passed as a parameter and are in PGM format (P2 or P5), where the values are y(rows)/x(cols) coordinates of the source_frame. The target frame dimension is based on mapfile dimensions: specified in the header of the mapfile and reflected in the number of datavalues. Dimensions of ymap and xmap must be equal. Datavalues must be positive or zero. Any datavalue in the ymap or xmap which value is higher then the source frame height or width is silently ignored, leaving a blank/chromakey pixel. This can safely be used as a feature to create overlays.
Algorithm digest: Target_frame[y][x] = Source_frame[ ymap[y][x] ][ [xmap[y][x] ];
Definition in file vf_remap.c.
#define OFFSET | ( | x | ) | offsetof(RemapContext, x) |
Definition at line 58 of file vf_remap.c.
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 59 of file vf_remap.c.
#define DEFINE_REMAP_PLANAR_FUNC | ( | name, | |
bits, | |||
div | |||
) |
remap_planar algorithm expects planes of same size pixels are copied from source to target using : Target_frame[y][x] = Source_frame[ ymap[y][x] ][ [xmap[y][x] ];
Definition at line 129 of file vf_remap.c.
#define DEFINE_REMAP_PACKED_FUNC | ( | name, | |
bits, | |||
div | |||
) |
remap_packed algorithm expects pixels with both padded bits (step) and number of components correctly set.
pixels are copied from source to target using : Target_frame[y][x] = Source_frame[ ymap[y][x] ][ [xmap[y][x] ];
Definition at line 178 of file vf_remap.c.
AVFILTER_DEFINE_CLASS | ( | remap | ) |
|
static |
Definition at line 74 of file vf_remap.c.
|
static |
Definition at line 221 of file vf_remap.c.
|
static |
Definition at line 248 of file vf_remap.c.
Referenced by config_output().
|
static |
Definition at line 287 of file vf_remap.c.
|
static |
Definition at line 335 of file vf_remap.c.
|
static |
Definition at line 341 of file vf_remap.c.
|
static |
Definition at line 61 of file vf_remap.c.
|
static |
Definition at line 348 of file vf_remap.c.
|
static |
Definition at line 365 of file vf_remap.c.
AVFilter ff_vf_remap |
Definition at line 374 of file vf_remap.c.