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");
90 uint8_t *shuffled_data[4] = { NULL };
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 },
164 .
name =
"shuffleplanes",
168 .priv_class = &shuffleplanes_class,
170 .
inputs = shuffleplanes_inputs,
171 .
outputs = shuffleplanes_outputs,