55 for (i = 0; i < s->
planes; i++) {
58 "Non-existing input plane #%d mapped to output plane #%d.\n",
64 (i == 1 || i == 2) != (s->
map[i] == 1 || s->
map[i] == 2)) {
66 "Cannot map between a subsampled chroma plane and a luma "
73 (i == 1) != (s->
map[i] == 1)) {
75 "Cannot map between a palette plane and a data plane.\n");
91 int shuffled_linesize[4] = { 0 };
94 for (i = 0; i < s->
planes; i++) {
95 shuffled_data[i] = frame->
data[s->
map[i]];
98 memcpy(frame->
data, shuffled_data,
sizeof(shuffled_data));
99 memcpy(frame->
linesize, shuffled_linesize,
sizeof(shuffled_linesize));
127 #define OFFSET(x) offsetof(ShufflePlanesContext, x)
128 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
130 {
"map0",
"Index of the input plane to be used as the first output plane ",
OFFSET(map[0]),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 4,
FLAGS },
131 {
"map1",
"Index of the input plane to be used as the second output plane ",
OFFSET(map[1]),
AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 4,
FLAGS },
132 {
"map2",
"Index of the input plane to be used as the third output plane ",
OFFSET(map[2]),
AV_OPT_TYPE_INT, { .i64 = 2 }, 0, 4,
FLAGS },
133 {
"map3",
"Index of the input plane to be used as the fourth output plane ",
OFFSET(map[3]),
AV_OPT_TYPE_INT, { .i64 = 3 }, 0, 4,
FLAGS },
159 .
name =
"shuffleplanes",
163 .priv_class = &shuffleplanes_class,
165 .
inputs = shuffleplanes_inputs,
166 .
outputs = shuffleplanes_outputs,
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
static const AVFilterPad outputs[]
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Main libavfilter public API header.
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
const char * name
Pad name.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static void copy(LZOContext *c, int cnt)
Copies bytes from input to output buffer with checking.
A filter pad used for either input or output.
AVFilter ff_vf_shuffleplanes
A link between two filters.
int width
width and height of the video frame
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
static const AVOption shuffleplanes_options[]
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
common internal API header
static int shuffleplanes_filter_frame(AVFilterLink *inlink, AVFrame *frame)
AVFILTER_DEFINE_CLASS(shuffleplanes)
#define AV_PIX_FMT_FLAG_PSEUDOPAL
The pixel format is "pseudo-paletted".
int format
agreed upon media format
static const AVFilterPad shuffleplanes_outputs[]
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
const char * name
Filter name.
AVFilterLink ** outputs
array of pointers to output links
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal and external API header
static av_cold int shuffleplanes_config_input(AVFilterLink *inlink)
static const AVFilterPad shuffleplanes_inputs[]
AVFilterContext * dst
dest filter
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.