diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-12-21 23:02:48 +0400 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-12-21 23:04:11 +0400 |
commit | a8ebb77493d6bd8af6f0b4008813583b20d1f002 (patch) | |
tree | dd998cd8a5655fb77004cb1f078f1c8b4ed4b367 | |
parent | a3a22c2178f8d85e9a135c0c5c5cb6f60aaad15d (diff) |
lavfi/swapuv: use FFSWAP
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r-- | libavfilter/vf_swapuv.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/libavfilter/vf_swapuv.c b/libavfilter/vf_swapuv.c index 2541c3f120..e7e5e88abd 100644 --- a/libavfilter/vf_swapuv.c +++ b/libavfilter/vf_swapuv.c @@ -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); } |