NO

Recent Posts

Pages: 1 ... 8 9 [10]
91
Tips & tricks / Re: Berkeley SoftFloat
« Last post by TimoVJL on August 11, 2017, 07:10:59 AM »
add
Code: [Select]
#include <stdlib.h>and use compiler option -Go Define compatibility names.
92
Tips & tricks / Re: Berkeley SoftFloat
« Last post by jack on August 11, 2017, 03:46:58 AM »
I built the softfloat lib with ioldouble included, but can't compile this simple example
Code: [Select]
#include <stdio.h>
#include "SoftFloat.h"
#include "primitiveTypes.h"

extern void e64toasc(extFloat80_t *x, char *string, int ndigs);
extern void asctoe64( char *s, extFloat80_t *x );

int __cdecl main(int argc, char **argv)
{
char buf[128]="3.1415926535897932384626433832795";
extFloat80_t f80;
asctoe64( buf, &f80 );
e64toasc( &f80, buf, 10 );
printf("%s\n",buf);
return 0;
}
POLINK: error: Unresolved external symbol 'alloca'
93
Tips & tricks / Re: Berkeley SoftFloat
« Last post by jack on August 11, 2017, 01:22:13 AM »
for input/output I use ioldouble from http://www.moshier.net/#Rubid_pc filename smldbl12.zip
94
User contributions / Re: Image Tools (Last Update)
« Last post by Grincheux on August 10, 2017, 05:12:18 PM »
I think it is complete.
For the instant I stop.
95
Tips & tricks / Re: Berkeley SoftFloat
« Last post by TimoVJL on August 10, 2017, 03:40:34 PM »
It happens, if someone opened workspace in poide.exe version 8 (32-bit)
96
Tips & tricks / Re: Berkeley SoftFloat
« Last post by jj2007 on August 10, 2017, 03:16:13 PM »
Any idea why the IDE tells me "Bad version on TestSoftFloat80X64.ppj"?
97
Tips & tricks / Re: Berkeley SoftFloat
« Last post by TimoVJL on August 10, 2017, 08:57:24 AM »
It was without source.

Downloaded from here

EDIT: project with source in zip TestSoftFloat80_WS_src.zip
98
Tips & tricks / Re: Berkeley SoftFloat
« Last post by jj2007 on August 10, 2017, 08:54:53 AM »
The IDE says
Don't know how to build "C:\Masm32\PellesC\Projects\Timo\SoftFloat\source\extF80_add.c".
 :(
Anything else missing?
99
Tips & tricks / Berkeley SoftFloat
« Last post by TimoVJL on August 09, 2017, 06:39:18 PM »
Berkeley SoftFloat support 80-bit and 128-bit floats too.
I try to get it work with PellesC.

example
Code: [Select]
#include <stdio.h>
#define SOFTFLOAT_FAST_INT64
#include <SoftFloat.h>
#include <primitiveTypes.h>
#if defined(_WIN64) || __POCC_TARGET__ >= 3
#pragma comment(lib, "SoftFloat3x64.lib")
#else
#pragma comment(lib, "SoftFloat3.lib")
#endif

int __cdecl main(int argc, char **argv)
{
char buf[128];
unsigned char *p;
extFloat80_t f80 = i32_to_extF80( 1 );
extFloat80_t f80s = extF80_add(f80, f80);
p = (unsigned char *)&f80;
for (int i=0; i<10; i++) printf("%02X ", (unsigned char)*p++);
puts("");
p = (unsigned char *)&f80s;
for (int i=0; i<10; i++) printf("%02X ", (unsigned char)*p++);
puts("");
float128_t f128 = ui64_to_f128( 1 );
p = (unsigned char *)&f128;
for (int i=0; i<16; i++) printf("%02X ", (unsigned char)*p++);
puts("");
return 0;
}
EDIT: missing platform.h and msvcrt_void.c added.
EDIT: project with source in zip TestSoftFloat80_WS_src.zip

To test ready-made libraries, use SoftFloat3_WS_test.zip and SoftFloat3lib.zip as example.
100
Tips & tricks / Re: Perceptual Hash
« Last post by Grincheux on August 09, 2017, 06:10:53 PM »
No, but it requires an image in RGBA, that makes me make too changes.
With it I get all images, I must select into a range (80..100%).
With BlockHash and pHash, you have to reduce te hash by converting the hash to bytes.
Its result is like this : 0,0,1,0,0,0,1,0 and have to be 00100010 (binary)
This is true if you only compare the average color with > operator.
If x > Average => Result = 1 ; else Result = 0.
If you compare with >, < and == you use use 2 bits rather than one.
What I want is to get automatically the similar images, and I think I have found.
I tested on many images, I found 95% of the similar images.

Code: [Select]
gflNegative(_GflBitmap,NULL) ; // Reverse all bits
gflSoften(_GflBitmap,NULL,100) ; // Apply an effect that looks like a blur
gflRotateFine(_GflBitmap,NULL,90.0,NULL) ; // Rotate the image by 90°
gflChangeColorDepth(_GflBitmap,NULL,GFL_MODE_TO_BINARY,GFL_MODE_NO_DITHER) ; // Reduce colors
gflResize(_GflBitmap,NULL,8,8,GFL_RESIZE_BILINEAR,0) ; // Resize image to 8x8
_lpImage = Image_GflBitmapToImage(_GflBitmap) ; // Get the image bits
Keccak(_lpImage->lpImageBits,256,_cResult) ; // Create a classic hash (stronger than MD5) See SPH.LIB with GOOGLE
Hex2Str(_cResult,(unsigned char *) __lpImageInfos->szHashSimilar,256 / 8) ; Convert the hash to an hexadecimal string
ImageFree(_lpImage) ; Free memory (Image_GflBitmapToImage)

After getting the image bits I have 256 bytes (8 * 8 * 4).
Normally I have to count the average color and compare it to the image bits
like this I get a pseudo hash  If I convert to hexa I get 512 bytes.
sprintf and wsprintf have a limit of 1024 bytes for the result, this makes me modify many lines of code.
I test this manner, but the result was not enougth good.
I also have tested many kind of gray conversion.
I have read many things, but too many uses pHash.

The main thing to keep is mind is to convert in gray and resized to 8x8. That gives a FlashCode for the image.
It is very interesting because on many thousands of images (uniques), the FlashCode is different!
For greather sizes (also tested) the result is bad.
When you resize the image, don't apply the image ratio.
Pages: 1 ... 8 9 [10]