anyone spotted code for bitstream ?
Hi, am putting together a VB6 prog to read xvid (mpeg4-ASP) AVI files "rawly" and make them packed-bitstream and vice versa. That requires mpeg4 bitstream handling of byte arrays which is quite a lot of masking and shifting. eg normally array byte 0 goes LSB to MSB 0 to 7, however an mpeg4 bitstream crossing bytes goes byte0bit7 = mpeg 0th bit ... bit0 = mpeg 7th bit, byte1bit7 = mpeg 8th bit, bit6 = 9th mpeg bit, etc.
Was hoping for some functions which return an arbitrary length of bits (up to 32) starting at an arbitrary mpeg4 bit position 0..n in the byte array, in a longword as an integer. eg mpeg4 bits 7,8="10" returned in a long as "10" which is integer 2. Can do it myself a long winded way, however wondered if someone smarter than I had done it already, possibly with system calls of some kind.
Re: anyone spotted code for bitstream ?
Thread moved from CodeBank forum (which is for you to post your code examples, not questions)
Re: anyone spotted code for bitstream ?
I'm wondering about this too. Removing packed bitstream from an AVI video is quite complicated and there are no VB6 examples available.
Re: anyone spotted code for bitstream ?
There's a C# example, and a Java example (Java is big-endian) but the code is slightly too obfuscated for me and C# requires .NET to run and Java require the JRE ... and it has access to bit shifting and unsigned integer instructions.