aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-01-06 04:36:42 +0100
committerClément Bœsch <ubitux@gmail.com>2013-01-06 04:37:33 +0100
commit521daf140977238c903a50ba9c704044974724f5 (patch)
tree9364bf57f2311309fabc4964a4a3ece1e4ea2cc6
parentc4bfb0f121d59c3e1e546126381a8c9375b78461 (diff)
downloadffmpeg-521daf140977238c903a50ba9c704044974724f5.tar.gz
lavfi/kerndeint: get pix format description only once.
This makes the code faster.
-rw-r--r--libavfilter/vf_kerndeint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_kerndeint.c b/libavfilter/vf_kerndeint.c
index 6b87ef6a1f..26f2e492af 100644
--- a/libavfilter/vf_kerndeint.c
+++ b/libavfilter/vf_kerndeint.c
@@ -147,6 +147,8 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpic)
const int sharp = kerndeint->sharp;
const int twoway = kerndeint->twoway;
+ const int is_packed_rgb = av_pix_fmt_desc_get(inlink->format)->flags & PIX_FMT_RGB;
+
outpic = ff_get_video_buffer(outlink, AV_PERM_WRITE|AV_PERM_ALIGN, outlink->w, outlink->h);
if (!outpic) {
avfilter_unref_bufferp(&inpic);
@@ -208,7 +210,6 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpic)
(abs((int)prvp[x] - (int)srcp[x]) > thresh) ||
(abs((int)prvpp[x] - (int)srcpp[x]) > thresh) ||
(abs((int)prvpn[x] - (int)srcpn[x]) > thresh)) {
- int is_packed_rgb = av_pix_fmt_desc_get(inlink->format)->flags & PIX_FMT_RGB;
if (map) {
g = x & ~3;