[FFmpeg-cvslog] yadif: fix slice sizes
Michael Niedermayer
git at videolan.org
Fri May 24 17:47:56 CEST 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri May 24 17:33:59 2013 +0200| [1d08e4b584cc8a12fa4b63bc13829f1e6d4f2e55] | committer: Michael Niedermayer
yadif: fix slice sizes
This more evenly distributes the load between threads
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d08e4b584cc8a12fa4b63bc13829f1e6d4f2e55
---
libavfilter/vf_yadif.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index 124ef91..8cd6f0d 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -190,9 +190,8 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
int refs = s->cur->linesize[td->plane];
int df = (s->csp->comp[td->plane].depth_minus1 + 8) / 8;
int pix_3 = 3 * df;
- int slice_h = td->h / nb_jobs;
- int slice_start = jobnr * slice_h;
- int slice_end = (jobnr == nb_jobs - 1) ? td->h : (jobnr + 1) * slice_h;
+ int slice_start = (td->h * jobnr ) / nb_jobs;
+ int slice_end = (td->h * (jobnr+1)) / nb_jobs;
int y;
/* filtering reads 3 pixels to the left/right; to avoid invalid reads,
More information about the ffmpeg-cvslog
mailing list