comparison libpostproc/postprocess.c @ 101:fcf4e8fcb34b libavcodec

fixed a sig4 bug an non mmx2 cpus (in case of more sig4 errors please send me a "disassemble $eip-16 $eip+16" from gdb)
author michael
date Sat, 13 Oct 2001 11:58:41 +0000
parents 1d1182345591
children 2cb2660cbd7e
comparison
equal deleted inserted replaced
100:1d1182345591 101:fcf4e8fcb34b
1907 "pushl %1 \n\t" 1907 "pushl %1 \n\t"
1908 "leal (%2,%2), %%eax \n\t" 1908 "leal (%2,%2), %%eax \n\t"
1909 "leal (%3,%3), %%ebx \n\t" 1909 "leal (%3,%3), %%ebx \n\t"
1910 "movq packedYOffset, %%mm2 \n\t" 1910 "movq packedYOffset, %%mm2 \n\t"
1911 "movq packedYScale, %%mm3 \n\t" 1911 "movq packedYScale, %%mm3 \n\t"
1912 "pxor %%mm4, %%mm4 \n\t"
1912 1913
1913 #define SCALED_CPY \ 1914 #define SCALED_CPY \
1914 "movq (%0), %%mm0 \n\t"\ 1915 "movq (%0), %%mm0 \n\t"\
1915 "movq (%0,%2), %%mm1 \n\t"\ 1916 "movq (%0,%2), %%mm1 \n\t"\
1916 "psubusb %%mm2, %%mm0 \n\t"\ 1917 "psubusb %%mm2, %%mm0 \n\t"\
1917 "psubusb %%mm2, %%mm1 \n\t"\ 1918 "psubusb %%mm2, %%mm1 \n\t"\
1918 "pxor %%mm4, %%mm4 \n\t"\ 1919 "movq %%mm0, %%mm5 \n\t"\
1919 "pxor %%mm5, %%mm5 \n\t"\ 1920 "punpcklbw %%mm4, %%mm0 \n\t"\
1920 "punpcklbw %%mm0, %%mm4 \n\t"\ 1921 "punpckhbw %%mm4, %%mm5 \n\t"\
1921 "punpckhbw %%mm0, %%mm5 \n\t"\ 1922 "psllw $7, %%mm0 \n\t"\
1922 "pmulhuw %%mm3, %%mm4 \n\t"\ 1923 "psllw $7, %%mm5 \n\t"\
1923 "pmulhuw %%mm3, %%mm5 \n\t"\ 1924 "pmulhw %%mm3, %%mm0 \n\t"\
1924 "packuswb %%mm5, %%mm4 \n\t"\ 1925 "pmulhw %%mm3, %%mm5 \n\t"\
1925 "movq %%mm4, (%1) \n\t"\ 1926 "packuswb %%mm5, %%mm0 \n\t"\
1926 "pxor %%mm4, %%mm4 \n\t"\ 1927 "movq %%mm0, (%1) \n\t"\
1927 "pxor %%mm5, %%mm5 \n\t"\ 1928 "movq %%mm1, %%mm5 \n\t"\
1928 "punpcklbw %%mm1, %%mm4 \n\t"\ 1929 "punpcklbw %%mm4, %%mm1 \n\t"\
1929 "punpckhbw %%mm1, %%mm5 \n\t"\ 1930 "punpckhbw %%mm4, %%mm5 \n\t"\
1930 "pmulhuw %%mm3, %%mm4 \n\t"\ 1931 "psllw $7, %%mm1 \n\t"\
1931 "pmulhuw %%mm3, %%mm5 \n\t"\ 1932 "psllw $7, %%mm5 \n\t"\
1932 "packuswb %%mm5, %%mm4 \n\t"\ 1933 "pmulhw %%mm3, %%mm1 \n\t"\
1933 "movq %%mm4, (%1, %3) \n\t"\ 1934 "pmulhw %%mm3, %%mm5 \n\t"\
1935 "packuswb %%mm5, %%mm1 \n\t"\
1936 "movq %%mm1, (%1, %3) \n\t"\
1934 1937
1935 "1: \n\t" 1938 "1: \n\t"
1936 SCALED_CPY 1939 SCALED_CPY
1937 "addl %%eax, %0 \n\t" 1940 "addl %%eax, %0 \n\t"
1938 "addl %%ebx, %1 \n\t" 1941 "addl %%ebx, %1 \n\t"
2071 packedYOffset|= packedYOffset<<16; 2074 packedYOffset|= packedYOffset<<16;
2072 packedYOffset|= packedYOffset<<8; 2075 packedYOffset|= packedYOffset<<8;
2073 2076
2074 scale= (double)(maxAllowedY - minAllowedY) / (double)(white-black); 2077 scale= (double)(maxAllowedY - minAllowedY) / (double)(white-black);
2075 2078
2076 packedYScale= (uint16_t)(scale*256.0 + 0.5); 2079 packedYScale= (uint16_t)(scale*512.0 + 0.5);
2077 packedYScale|= packedYScale<<32; 2080 packedYScale|= packedYScale<<32;
2078 packedYScale|= packedYScale<<16; 2081 packedYScale|= packedYScale<<16;
2079 } 2082 }
2080 else 2083 else
2081 { 2084 {