Re: [FFmpeg-devel] [PATCH 2/9] avfilter/vf_perspective: use lrint instead of floor hack

2015-12-02 Thread Ganesh Ajjanagadde
On Tue, Dec 1, 2015 at 9:10 PM, Michael Niedermayer  wrote:
> On Tue, Dec 01, 2015 at 07:27:51PM -0500, Ganesh Ajjanagadde wrote:
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavfilter/vf_perspective.c | 10 +-
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> should be ok

pushed, thanks

>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Old school: Use the lowest level language in which you can solve the problem
> conveniently.
> New school: Use the highest level language in which the latest supercomputer
> can solve the problem without the user falling asleep waiting.
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/9] avfilter/vf_perspective: use lrint instead of floor hack

2015-12-01 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde 
---
 libavfilter/vf_perspective.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_perspective.c b/libavfilter/vf_perspective.c
index 970870c..13053f1 100644
--- a/libavfilter/vf_perspective.c
+++ b/libavfilter/vf_perspective.c
@@ -213,10 +213,10 @@ static int config_input(AVFilterLink *inlink)
 for (x = 0; x < w; x++){
 int u, v;
 
-u = (int)floor(SUB_PIXELS * (x0 * x + x1 * y + x2) /
-(x6 * x + x7 * y + x8) + 0.5);
-v = (int)floor(SUB_PIXELS * (x3 * x + x4 * y + x5) /
-(x6 * x + x7 * y + x8) + 0.5);
+u =  lrint(SUB_PIXELS * (x0 * x + x1 * y + x2) /
+(x6 * x + x7 * y + x8));
+v =  lrint(SUB_PIXELS * (x3 * x + x4 * y + x5) /
+(x6 * x + x7 * y + x8));
 
 s->pv[x + y * w][0] = u;
 s->pv[x + y * w][1] = v;
@@ -235,7 +235,7 @@ static int config_input(AVFilterLink *inlink)
 sum += temp[j];
 
 for (j = 0; j < 4; j++)
-s->coeff[i][j] = (int)floor((1 << COEFF_BITS) * temp[j] / sum + 
0.5);
+s->coeff[i][j] = lrint((1 << COEFF_BITS) * temp[j] / sum);
 }
 
 return 0;
-- 
2.6.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/9] avfilter/vf_perspective: use lrint instead of floor hack

2015-12-01 Thread Michael Niedermayer
On Tue, Dec 01, 2015 at 07:27:51PM -0500, Ganesh Ajjanagadde wrote:
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavfilter/vf_perspective.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)

should be ok

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel