Commit a8ebb774 authored by Paul B Mahol's avatar Paul B Mahol

lavfi/swapuv: use FFSWAP

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent a3a22c21
......@@ -33,32 +33,17 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
{
AVFilterBufferRef *picref =
ff_default_get_video_buffer(link, perms, w, h);
uint8_t *tmp;
int tmp2;
tmp = picref->data[2];
picref->data[2] = picref->data[1];
picref->data[1] = tmp;
tmp2 = picref->linesize[2];
picref->linesize[2] = picref->linesize[1];
picref->linesize[1] = tmp2;
FFSWAP(uint8_t*, picref->data[1], picref->data[2]);
FFSWAP(int, picref->linesize[1], picref->linesize[2]);
return picref;
}
static int filter_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
{
uint8_t *tmp_data;
int tmp_linesize;
tmp_data = inpicref->data[1];
inpicref->data[1] = inpicref->data[2];
inpicref->data[2] = tmp_data;
tmp_linesize = inpicref->linesize[1];
inpicref->linesize[1] = inpicref->linesize[2];
inpicref->linesize[2] = tmp_linesize;
FFSWAP(uint8_t*, inpicref->data[1], inpicref->data[2]);
FFSWAP(int, inpicref->linesize[1], inpicref->linesize[2]);
return ff_filter_frame(link->dst->outputs[0], inpicref);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment