> Any reason for not using 8/16/32 bit as a fraction (0-1)? So 8 bit would > have a resolution of 1/255, 16 bit of 1/65535 etc. All operations can > be done with 4 byte integer math.
16 bits linear will be barely enough to capture an 8 bit nonlinear space, and that's leaving out head- and toe-room. So we're at 32 bit already. On top of that, we'll need much deeper resolution to avoid substantial quantization errors moving to/from the PCM space. This will possibly be pushing the limits of 32 bits, especially for high dynamic range spaces. Then we have to worry about overflow/underflow/saturation and 64-bit multiplies (32 bit builds will need custom intrinsics). Part of my impetus for suggesting float was avoiding any unnecessary cleverness. > Multiplying cannot cause overflows this way. Easy resolution change, too. I don't see how that's different from float. > Lookup-tables can be used if necessary - a near impossibility with floats. This is a point... but I _am_ using lookup tables in my float code. There may be a better choice than modff, but it works, and I don't think it's even close to a bottleneck (I'd expect it to be memory fetch). > Possibly great speadups as integer ops can be executed in parallel, > either in the CPU or the GPU. I'm used to the CPU's FPU being more powerful in general than the ALU these days. I'm also concerned that premature optimization where everything has to be SIMD out of the box just means the code never gets written, or never fully debugged (the existing Cinelerra colorspace code isn't even SIMD, but it is horrbily buggy). I curse many many things about Cinelerra... the pipeline speed isn't actually one of them. > Just an idea. Sure :-) And I think you're right in the tactical sense... but overall I think float is a more practical idea. It will be slower in the ideal case, but I don't think we'll ever be within spitting distance of ideal speed. Monty _______________________________________________ Cinelerra mailing list [email protected] https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra
