| | |
Need Some Bit Twiddling Help on File Post Processing
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2008
Posts: 25
Reputation:
Solved Threads: 0
Hi,
I am struggling with the best way to twiddle a large number of bits.
What I have is a large amount of binary files(~100) in my directory that I need to do post processing on. I want to compare all the bytes in each file and see when the bytes have changed and then assign it a value.
For example,
I see that bit 2 for byte 0 of File 2 flipped bits changed from a 1->0. When this happens I want to note that byte0, bit 2 is assigned the value of File 2. I want to do this for every single byte in all the binary files.
Basically, what I am doing is a current schmoo. So File 1 is the binary dump being read at a specific current, and File 2 is another current and so forth. I want to see when the bits flip to determine what current the bits are at. So if I see a bit flip from 1->0 on File 56 then I know that the bit has a current of the File 56 value.
I was thinking of doing an XOR with the bytes but I thought I heard something about XOR operation being slow, so I was trying to think of some bit shifting technique. I am dealing with a lot of files so I want to find some technique that will process the data quickly. Can anyone help? Thanks!!
I am struggling with the best way to twiddle a large number of bits.
What I have is a large amount of binary files(~100) in my directory that I need to do post processing on. I want to compare all the bytes in each file and see when the bytes have changed and then assign it a value.
For example,
C++ Syntax (Toggle Plain Text)
File 1:byte[0] = 0000 0110 File 2:byte[0] = 0000 0010
I see that bit 2 for byte 0 of File 2 flipped bits changed from a 1->0. When this happens I want to note that byte0, bit 2 is assigned the value of File 2. I want to do this for every single byte in all the binary files.
Basically, what I am doing is a current schmoo. So File 1 is the binary dump being read at a specific current, and File 2 is another current and so forth. I want to see when the bits flip to determine what current the bits are at. So if I see a bit flip from 1->0 on File 56 then I know that the bit has a current of the File 56 value.
I was thinking of doing an XOR with the bytes but I thought I heard something about XOR operation being slow, so I was trying to think of some bit shifting technique. I am dealing with a lot of files so I want to find some technique that will process the data quickly. Can anyone help? Thanks!!
![]() |
Similar Threads
- Beginner: How do I read in one bit/byte at a time from a file? (Python)
- Image Processing - Anyone please (Java)
- Reading large text file (C)
- Big Text File Processing (Python)
- C - http post -how do u pass url? and how to post a file? (C)
- Where is mencoders -vf pp (post processing filter) (*nix Software)
- 16 bit Windows Subsystem (Windows NT / 2000 / XP)
- Please HELP! Cause anyone?? (Troubleshooting Dead Machines)
Other Threads in the C++ Forum
- Previous Thread: Closing QTabWidget
- Next Thread: GUI tutorials for Linux
Views: 328 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays based beginner binary c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sort sorting spoonfeeding string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





