[x265] Two bugs and one feature request

JMK three4teen16 at coldmail.nu
Mon Aug 12 06:07:36 CEST 2013


On Windows XP, using the MinGW builds:

1) after commit fabc072, x265.exe crashes at the end of the encodes, the last frame of the sequence is not encoded; at the Videohelp forums, someone suggested the following workaround, which was tested and works:

{{
To fix the crash at the end of encoding, open the file source\Lib\TLibEncoder\TEncTop.cpp, go to line 99 and change
 delete [] m_GOPEncoder;
 to
 delete m_GOPEncoder;

 That's all. While we are at it, there is also another bug that occurs when the file size of the input file exceeds the limits of integer representation. It manifests itself as negative number of frames to process and also negative eta in the information messages. To fix it, open source\input\yuv.cpp, go to line 55 and change
 return (int)(size - cur) / (width * height * pixelbytes * 3 / 2);
 to
 return (unsigned)(size - cur) / (width * height * pixelbytes * 3 / 2);

 The same may have to be applied on the file source\input\y4m.cpp, line 187 (Y4MInput::guessFrameCount() method)
}}

2) On Windows XP, with various MSVC builds found on the Internet:

a) error message "x265.exe is not a valid Win32 application"

b) error message "The procedure entry point InterlockedCompareExchange64 could not be located  in the dynamic link library KERNEL32.dll" --- about this problem, someone wrote:

{{
If you are building in Windows 7, then the problem must be the version of Windows itself. What I believe happens is this: In wavefront.cpp there is:

Code:
#define ATOMIC_OR(ptr, mask)            _InterlockedOr64((volatile LONG64*)ptr, mask)
#if defined(__MSC_VER) && !defined(__INTEL_COMPILER)
#pragma intrinsic(_InterlockedCompareExchange64)
#endif
#else // if _WIN32_WINNT <= _WIN32_WINNT_WINXP
#define ATOMIC_OR(ptr, mask)            InterlockedOr64((volatile LONG64*)ptr, mask)

Since you are on Windows 7, _WIN32_WINNT version is _WIN32_WINNT_WIN7 (0x0601), which is bigger than _WIN32_WINNT_WINXP (0x0501). As a result, the non-intrinsic InterlockedCompareExchange64 is called implicitly by the non-intrinsic InterlockedOr64 and the consequence is that the exe runs fine on your system plus any other system with OS later than WINXP, but not on WINXP itself. I do not use MSVC, but what I would recommend as a tentative fix is to set the define -D_WIN32_WINNT=0x501 in the cmake gui CMAKE_C_FLAGS and CMAKE_CXX_FLAGS (need to click the Advanced checkbox for those to appear). Or whatever might be needed to trick the compiler into thinking that your _WIN32_WINNT version is less than 0x0601.
}}

Feature request:

considering the "x265 Mission Statement" document says:

{{
The x265 project has licensed the rights to utilize and modify x264
source code in x265
}}

could you please port the stdin and Avisynth support of x264 to x265?
Because it's a matter of *usability* ---
--- raw video files are HUGE, whereas stdin consumes no space and
Avisynth scripts are tiny.

Thanks for the attention.


_____________________________________________________________
ps. Do you like my email address? Get yourself a coldmail.nu address too
http://www.coldmail.nu (it's free!)


More information about the x265-devel mailing list