View Full Version : X264 bug
iambaeba1
30th June 2005, 03:32
I found the x264's bug.
encoder/anaysyse.c...
static void x264_mb_analyse_inter_p16x16( x264_t *h, x264_mb_analysis_t *a )
{
double f64Data=0;
f64Data = f64Data + 2;
}
In X264, I declared double type variable.
Where the function is called in first, f64Data's value is 2.
But the fucnion is called in second, f64Data value is crashed !
And I decalred int type variable.
static void x264_mb_analyse_inter_p16x16( x264_t *h, x264_mb_analysis_t *a )
{
int n32Data=0;
n32Data = n32Data + 2;
}
Above the source code is good. First, second, third... good
I don't know the above problem.
Best regards.
Bae
Manao
30th June 2005, 06:15
For those who don't read the ML, here is the cause : during the ME analysis, float computations are prevented, because the arithmetic cpu and the simd optimizations can't be used together if a special instruction, 'emms', isn't called inbetween. Since that instruction can cost as much as 80 clock's ticks, and since float / double computations are useless at the macroblock level, the 'emms' isn't added after each call to a mmx / isse / sse2 function, hence the crash observed by iambeaba1
iambaeba1
30th June 2005, 06:40
Thanks... ^_^
Joe Fenton
30th June 2005, 07:17
What about using SSE scalar ops for that instead? Does floating point have an advantage here?
iambaeba1
30th June 2005, 09:09
I needed the statistic information of ME routines. So I inserted the floating point variables into the ME routines. Not for speed...only get the information of staticstics
of each routines.
^^;;;
bill_baroud
30th June 2005, 12:57
AFAIK, the XMM's 128bits registers aren't interleaved with the floating-point registers, as the MMX's ones are, so you don't need an "emms" when using SSE/SSE2 ... or i missed something ?
akupenguin
30th June 2005, 16:37
AFAIK, the XMM's 128bits registers aren't interleaved with the floating-point registers, as the MMX's ones are, so you don't need an "emms" when using SSE/SSE2 ... or i missed something ?
Correct, but most of x264's functions are only MMX and not SSE2.
Joe Fenton
1st July 2005, 06:17
That's the point. You should be able to do FP in those routines using SSE scalar ops instead of x87 FPU ops. It won't interfere with MMX since SSE doesn't share resources with x87/MMX.
So if the stats would be more accurate with FP and MMX keeps you from using x87 FPU, you could use SSE instead (assuming SSE is available on the CPU).
If integer is accurate enough for the stats, then it doesn't matter - just leave it integer.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.