[x264-devel] Wrong instruction

SIEGERSTEIN siegerstein at pochta.ru
Tue Oct 23 19:20:45 CEST 2007


В сообщении от Tuesday 23 October 2007 19:20:55 Guillaume Poirier написал(а):
> Hello,
>
> SIEGERSTEIN wrote:
> > Hi! I found, that x264 encoder convert with wrong instruction:
> >
> > $ x264 --bitrate=700 --fps=30 --me=umh --merange=32 --subme=7
> > --analyse=all -o output.mkv colourbars_420.yuv 640x480
> > x264 [info]: using cpu capabilities: MMX MMXEXT SSE SSE2
> > x264 [info]: slice I:1     Avg QP:34.00  size: 16866  PSNR Mean Y:34.77
> > U:35.79 V:34.82 Avg:34.93 Global:34.93
> > x264 [info]: mb I  I16..4: 26.8%  0.0% 73.2%
> > x264 [info]: final ratefactor: 37.49
> > x264 [info]: SSIM Mean Y:0.9979993
> > x264 [info]: PSNR Mean Y:34.768 U:35.790 V:34.817 Avg:34.931
> > Global:34.931 kb/s:4047.84
> >
> > encoded 1 frames, 4.97 fps, 4173.84 kb/s
> > $
> >
> > I have Intel processor, so there is only MMX but not MMXEXT instruction.
> >
> > $ cat /proc/cpuinfo
> > processor       : 0
> > vendor_id       : GenuineIntel
> > cpu family      : 15
> > model           : 3
> > model name      : Intel(R) Pentium(R) 4 CPU 3.00GHz
> > stepping        : 4
> > cpu MHz         : 2998.753
> > cache size      : 1024 KB
> > physical id     : 0
> > siblings        : 2
> > core id         : 0
> > cpu cores       : 1
> > fdiv_bug        : no
> > hlt_bug         : no
> > f00f_bug        : no
> > coma_bug        : no
> > fpu             : yes
> > fpu_exception   : yes
> > cpuid level     : 5
> > wp              : yes
> > flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> > mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
> > constant_tsc pebs bts sync_rdtsc pni monitor ds_cpl cid xtpr
> > bogomips        : 6001.69
> > clflush size    : 64
>


> MMXExt is supported by your CPU. Your problem must be elsewhere.

Where you see MMXEXT suport in my processor ?!?
I see only SSSE, SSE2, SSE3(pni) and MMX instructions.


MMXEXT is exclusive to AMD processors.

Look here, it's from AMD Athlon XP processor:

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 8
model name      : AMD Athlon(tm) XP 2400+
stepping        : 1
cpu MHz         : 1994.496
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow up ts
bogomips        : 3992.36
clflush size    : 32

I see here: mmxext  3dnowext  3dnow  instruction. It's exclusive to AMD 
family.

>
> [..]
>
> > [encode_x264.so] set display aspect ratio to input
> > [encode_x264.so] using SAR=1/1
> > [encode_x264.so] using cpu capabilities: MMX MMXEXT SSE SSE2 3DNow!
> >
> > Program received signal SIGFPE, Arithmetic exception.
> > [Switching to Thread 0xb7bab6c0 (LWP 3313)]
> > 0xa5a9b4d0 in get_qscale (h=0x80d47a0, rce=0xbf9d0690,
> > rate_factor=64.667029215144737, frame_num=<value optimized out>) at
> > encoder/ratecontrol.c:1003
> > 1003        };
> > (gdb)
>


> Please compile with debug symbols, otherwise we can't help you.

It already compile with debug symbols:

$ ./configure --enable-gtk --enable-pthread --enable-debug --enable-visualize --enable-shared 
--extra-cflags="-march=prescott -mtune=prescott -pipe -O2 -ggdb"


> > Now I see +3DNow! instruction:
> >
> > [encode_x264.so] using cpu capabilities: MMX MMXEXT SSE SSE2 3DNow!
> >
> > I think problem in x264 not in transcode (I'm now devloper :))
> >
> > encoder/encoder.c: (x264)
> >
> > 675      x264_log( h, X264_LOG_INFO, "using cpu
> > capabilities: %s%s%s%s%s%s%s%s\n",
> >    676               param->cpu&X264_CPU_MMX ? "MMX " : "",
> >    677               param->cpu&X264_CPU_MMXEXT ? "MMXEXT " : "",
> >    678               param->cpu&X264_CPU_SSE ? "SSE " : "",
> >    679               param->cpu&X264_CPU_SSE2 ? "SSE2 " : "",
> >    680               param->cpu&X264_CPU_SSSE3 ? "SSSE3 " : "",
> >    681               param->cpu&X264_CPU_3DNOW ? "3DNow! " : "",
> >    682               param->cpu&X264_CPU_ALTIVEC ? "Altivec " : "",
> >    683               param->cpu ? "" : "none!" );
> >
> > open discussion in transcode mail list:
> > http://article.gmane.org/gmane.comp.video.transcode.user/20861
> >
> >
> > How compile x264 withOUT 3dnow! & mmxext instruction?
>
> It can't easily be done through a configure switch
> , so IMHO, first 
> just try to reproduce your bug with libx264 compile with debug
> symbols, then we'll see what we can do for you :)

It build with debug symbols... 

>
> Guillaume
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> http://mailman.videolan.org/listinfo/x264-devel





More information about the x264-devel mailing list