24-bit

Reducing sample bit-depth by truncating

…衆ロ難τιáo~ 提交于 2020-05-26 09:59:10
问题 I have to reduce the bit-depth of a digital audio signal from 24 to 16 bit. Taking only the 16 most significant bits (i.e. truncating) of each sample is equivalent to doing a proportional calculation (out = in * 0xFFFF / 0xFFFFFF)? 回答1: I assume you mean (in * 0xFFFF) / 0xFFFFFF , in which case, yes. 回答2: You'll get better sounding results by adding a carefully crafted noise signal to the original signal, just below the truncating threshold, before truncating (a.k.a. dithering). 回答3: x *

How to create a bmp file from byte[] in C#

夙愿已清 提交于 2019-12-17 22:16:58
问题 I have a byte[] array received in TCP Client.The array contains a 24-bit RGB Bitmap file.How to create that bitmap file with given Width ,Height and data? In C++ I use this int WriteBitmapFile(const char *filename, int width, int height, unsigned char *imageData) { FILE *filePtr; // file pointer BITMAPFILEHEADER bitmapFileHeader; // bitmap file header BITMAPINFOHEADER bitmapInfoHeader; // bitmap info header DWORD imageIdx; // used for swapping RGB->BGR unsigned char tempRGB; // used for

Why 24 bits registers?

回眸只為那壹抹淺笑 提交于 2019-12-07 05:25:03
问题 In my work I deal with different micro-controllers, micro-processors and DSP processors. Many of them have 24-bits registers and counters. I know how to use them, this is not my question. My question is why do they have 24-bits register! why not make it 32 bit? and as I know, it is not a problem of size, because the registers are already 32bits, but have maximum of 0xFFFFFF. Do this provide easier HW implementation? Faster calculations? Or it is just "hmmm, lets put 24-bits registers to make

Why 24 bits registers?

半世苍凉 提交于 2019-12-05 09:55:31
In my work I deal with different micro-controllers, micro-processors and DSP processors. Many of them have 24-bits registers and counters. I know how to use them, this is not my question. My question is why do they have 24-bits register! why not make it 32 bit? and as I know, it is not a problem of size, because the registers are already 32bits, but have maximum of 0xFFFFFF. Do this provide easier HW implementation? Faster calculations? Or it is just "hmmm, lets put 24-bits registers to make the job of programmers more hard"? My guess is that most DSP applications simply don't need 32-bits.

Padding in 24-bits rgb bitmap

 ̄綄美尐妖づ 提交于 2019-12-04 18:31:52
问题 could somebody explain to me why in 24-bit rgb bitmap file I have to add a padding which size depends on width of image ? What for ? I mean I must add this code to my program (in C): if( read % 4 != 0 ) { read = 4 - (read%4); printf( "Padding: %d bytes\n", read ); fread( pixel, read, 1, inFile ); } 回答1: Because 24 bits is an odd number of bytes (3) and for a variety of reasons all the image rows are required to start at an address which is a multiple of 4 bytes. 回答2: According to Wikipedia,

C/C++ - Convert 24-bit signed integer to float

坚强是说给别人听的谎言 提交于 2019-12-01 02:22:59
问题 I'm programming in C++. I need to convert a 24-bit signed integer (stored in a 3-byte array) to float (normalizing to [-1.0,1.0]). The platform is MSVC++ on x86 (which means the input is little-endian). I tried this: float convert(const unsigned char* src) { int i = src[2]; i = (i << 8) | src[1]; i = (i << 8) | src[0]; const float Q = 2.0 / ((1 << 24) - 1.0); return (i + 0.5) * Q; } I'm not entirely sure, but it seems the results I'm getting from this code are incorrect. So, is my code wrong

How to convert 24 bit RGB to 8 bit RGB

徘徊边缘 提交于 2019-11-30 17:27:15
问题 I was wondering what is the best way to convert a 24-bit RGB color (8 bits per color) into an 8-bit color (2bits Blue, 3 Green, 3 Red). I'd like C code for doing this. 回答1: 8 bit RGB is normally an indexed (palettized) color format, see Palette (computing). The way you described it though, getting 8 bpp out of 24 bpp is pretty straightforward - you would need to strip least significant bits and merge the bits into single byte value, per pixel. AFAIK it is not a standard or well-known pixel

How to create a bmp file from byte[] in C#

老子叫甜甜 提交于 2019-11-28 18:02:52
I have a byte[] array received in TCP Client.The array contains a 24-bit RGB Bitmap file.How to create that bitmap file with given Width ,Height and data? In C++ I use this int WriteBitmapFile(const char *filename, int width, int height, unsigned char *imageData) { FILE *filePtr; // file pointer BITMAPFILEHEADER bitmapFileHeader; // bitmap file header BITMAPINFOHEADER bitmapInfoHeader; // bitmap info header DWORD imageIdx; // used for swapping RGB->BGR unsigned char tempRGB; // used for swapping // open file for writing binary mode filePtr = fopen(filename, "wb"); if (!filePtr) return 0; //