[vlc-commits] deinterlace: bugfix to CalculateInterlaceScore()
Juha Jeronen
git at videolan.org
Mon May 2 17:23:52 CEST 2011
vlc | branch: master | Juha Jeronen <juha.jeronen at jyu.fi> | Mon May 2 17:30:45 2011 +0300| [236fd4303c8e6f8d8ac7bb5accc9a5ec631001e3] | committer: Jean-Baptiste Kempf
deinterlace: bugfix to CalculateInterlaceScore()
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=236fd4303c8e6f8d8ac7bb5accc9a5ec631001e3
---
modules/video_filter/deinterlace/helpers.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/modules/video_filter/deinterlace/helpers.c b/modules/video_filter/deinterlace/helpers.c
index cbb4589..6802e99 100644
--- a/modules/video_filter/deinterlace/helpers.c
+++ b/modules/video_filter/deinterlace/helpers.c
@@ -469,7 +469,8 @@ int CalculateInterlaceScore( const picture_t* p_pic_top,
/* Amount of bits must be known for MMX, thus int32_t.
Doesn't hurt the C implementation. */
- int32_t i_score = 0;
+ int32_t i_score_mmx = 0; /* this must be divided by 255 when finished */
+ int32_t i_score_c = 0; /* this counts as-is (used for non-MMX parts) */
#ifdef CAN_COMPILE_MMXEXT
unsigned u_cpu = vlc_CPU();
@@ -579,7 +580,7 @@ int CalculateInterlaceScore( const picture_t* p_pic_top,
*/
int_fast32_t comb = (P - C) * (N - C);
if( comb > T )
- ++i_score;
+ ++i_score_c;
++p_c;
++p_p;
@@ -599,12 +600,12 @@ int CalculateInterlaceScore( const picture_t* p_pic_top,
#ifdef CAN_COMPILE_MMXEXT
if( u_cpu & CPU_CAPABILITY_MMXEXT )
{
- movd_r2m( mm7, i_score );
+ movd_r2m( mm7, i_score_mmx );
emms();
- i_score /= 255;
+ i_score_mmx /= 255;
}
#endif
- return i_score;
+ return i_score_mmx + i_score_c;
}
#undef T
More information about the vlc-commits
mailing list