Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Nov 2006
Location: London, UK
Posts: 99
|
Issue introduced in libx264 r1077
Since r1077 of libx264, Avidemux crashes when encoding if b_transform_8x8 (--8x8dct) is turned off. Unfortunately the issue doesn't occur in debug builds or when run through gdb. I have only be able to test the issue on Windows 32-bit so not sure if it occurs on other OSes or CPUs.
The only error I can capture is logged by Avidemux's error handler: Code:
*********** EXCEPTION ************** Registers: EAX: 000010C2 EBX: 000001AD ECX: 10000000 EDX: 00000000 ESI: 00000000 EDI: 00000002 ESP: 0021C260 EBP: 000001AD EIP: 6F7CF14D EFlags: 00010246 Exception Code: EXCEPTION_INT_DIVIDE_BY_ZERO (C0000094) Exception Flags: 00000000 Origin: C:\Program Files\Avidemux 2.4\libx264-66.dll(x264_macroblock_analyse+0x4F14D) [0x6F7CF14D] *********** EXCEPTION **************
__________________
Download Avidemux for Windows |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: May 2006
Posts: 957
|
Are you only getting this with the library? If you can reproduce it with the binary, try a debug build with full optimisations: http://users.telenet.be/darnley/x264/x264-debug+opts.7z
Another bug, which was just fixed, only appeared for one guy when the opts were on.
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. Last edited by J_Darnley; 16th February 2009 at 15:44. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Nov 2006
Location: London, UK
Posts: 99
|
I'm only getting the problem with the library. I can't get the CLI to fail. Another user is getting the same problem on Windows. Most users probably don't turn off the 8x8dct option (which Avidemux 2.4 turns on by default) so the reports will be low.
Is there an easy way to compile x264.exe to use libx264.dll rather than compiliing everything into the exe?
__________________
Download Avidemux for Windows |
![]() |
![]() |
![]() |
#4 | Link |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,269
|
Here are fresh builds, please test:
http://forum.doom9.org/showpost.php?...postcount=1041 I included a debug build plus a debug build with optimizations ![]()
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
![]() |
![]() |
![]() |
#5 | Link |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Well, we already know where that crash is, because there's only one IDIV in macroblock_analyse.
Code:
if( i_intra_cost == COST_MAX ) i_intra_cost = i_cost * i_satd_intra / i_satd_inter + 1; Code:
if( i_intra_cost == COST_MAX ) i_intra_cost = i_cost * i_satd_intra / (i_satd_inter + 1); |
![]() |
![]() |
![]() |
#6 | Link |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,269
|
So the cause of the problem was found, right? But wouldn't that effect the CLI encoder too?
![]()
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
![]() |
![]() |
![]() |
#8 | Link |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,269
|
Are you going to fix it anyway?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: Nov 2006
Location: London, UK
Posts: 99
|
I can reproduce a crash with basically every revision from r1077 to r1114. Debug builds or running the process through gdb stops it from crashing so perhaps it may not have been introduced in r1077 but it's the first revision I can reliably reproduce the fault.
__________________
Download Avidemux for Windows |
![]() |
![]() |
![]() |
#10 | Link |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,269
|
Did you try a debug build with optimizations yet? Normally debug builds don't have optimizations enabled.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
![]() |
![]() |
![]() |
#11 | Link |
Registered User
Join Date: Nov 2006
Location: London, UK
Posts: 99
|
Yes I have.
__________________
Download Avidemux for Windows |
![]() |
![]() |
![]() |
#12 | Link |
Registered User
Join Date: Nov 2006
Location: London, UK
Posts: 99
|
If it helps, this seems to make the problem disappear.
__________________
Download Avidemux for Windows |
![]() |
![]() |
![]() |
#13 | Link |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
If that makes the problem disappear, there is something more subtle wrong; i_satd_inter should never, ever, ever be zero. A quick trace of the good shows that it being zero is in fact physically impossible if the code works as intended.
More precisely: a->i_lambda * (log2f(i+1)*2 + 0.718f + !!i) + .5f; i_satd_inter cannot equal zero unless this line, for i >= 0 and a->i_lambda >= 1, can equal zero.
__________________
Follow x264 development progress | akupenguin quotes | x264 git status ffmpeg and x264-related consulting/coding contracts | Doom10 Last edited by Dark Shikari; 16th February 2009 at 21:50. |
![]() |
![]() |
![]() |
#14 | Link |
Registered User
Join Date: Nov 2006
Location: London, UK
Posts: 99
|
After adding logging, i_satd_inter equals 0 after about 35 frames. Any debug code you'd like me to add to pinpoint it further?
__________________
Download Avidemux for Windows |
![]() |
![]() |
![]() |
#16 | Link |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,269
|
So is the fix (maybe better "workaround") proposed in post #5 still valid?
I mean, is it okay to apply that change until the actual cause of the problem is resolved ???
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
![]() |
![]() |
![]() |
#17 | Link |
Registered User
Join Date: Nov 2006
Location: London, UK
Posts: 99
|
If I add logging around this line the problem goes away. Since this is one of the lines introduced in r1077 it tends to suggest something is going awry in this area.
__________________
Download Avidemux for Windows |
![]() |
![]() |
![]() |
#19 | Link |
Registered User
Join Date: Nov 2006
Location: London, UK
Posts: 99
|
Perhaps MinGW's implementation of log2f is faulty?
__________________
Download Avidemux for Windows |
![]() |
![]() |
![]() |
#20 | Link | |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,269
|
Quote:
![]()
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|