View Full Version : On2 VP6 bSettings struct
Sirber
23rd March 2006, 02:40
Anyone got the struct (C++) for handling bSettings in registry?
Sirber
23rd March 2006, 04:00
"bSettings"=hex:00,00,00,00,2C,01,00,00,00,00,00,00,2C,2C,2C,00,00,00,00,00,2C,
I found :
"2C 02" = 556kbps!!!
"2C 01" = 300kbps.
"01 00" = 1kbps.
"00 00" = 0kbps.
2C01 in base16 gives 11265 in base10, not 300. am I missing something?
Also, bitrate is stored in "small int", so 2 bytes.
Sirber
23rd March 2006, 04:04
"2C 02" = 556kbps!!!
"2C 01" = 300kbps.
"01 00" = 1kbps.
"00 00" = 0kbps.They actually inverted the numbers.
2C 01 --> 01 2C = 300 in base 10
2C 02 --> 02 2C = 556 in base 10!!!
Sirber rock the house! :cool:
Seb.26
23rd March 2006, 10:08
Little endian ... ;)
PS: what version of VP6 are you using ? ( really great codec, no ? )
Sirber
23rd March 2006, 12:52
VP62
What is "Little endian" in C++?
dimzon
23rd March 2006, 12:53
little endian / big endian is byteorder
Sirber
23rd March 2006, 14:17
thanks!
I'll borrow the C++ book from work :)
Sirber
24th March 2006, 01:42
void LoadOneCodecParam(FILE* fileState, COMPVARS* cvar)
{
LONG lStateSize;
void* memState;
ZeroMemory(cvar, sizeof(COMPVARS));
cvar->cbSize = sizeof(COMPVARS);
cvar->dwFlags = ICMF_COMPVARS_VALID;
cvar->fccType = ICTYPE_VIDEO;
fread(&cvar->fccHandler, sizeof(cvar->fccHandler), 1, fileState);
fread(&cvar->lKey, sizeof(cvar->lKey), 1, fileState);
fread(&cvar->lQ, sizeof(cvar->lQ), 1, fileState);
fread(&cvar->lDataRate, sizeof(cvar->lDataRate), 1, fileState);
fread(&lStateSize, sizeof(lStateSize), 1, fileState);
memState = malloc(lStateSize);
fread(memState, lStateSize, 1, fileState);
cvar->hic = ICOpen(cvar->fccType, cvar->fccHandler, ICMODE_COMPRESS);
if ( !(cvar->hic) ) {
free(memState);
ShowErrorAndExit("Unable to open compressor with FourCC \"%s\".",
FourCCToString(cvar->fccHandler));
}
// Ignore return (ICSetState sometimes returns 0 even when successful)
ICSetState(cvar->hic, memState, lStateSize);
free(memState);
}Sorry for my noobiness in C++ :)
I'd like to be able to browse memState to change some datas. I tryed to change "void* memState;" to "char* memState;", but it doesn't want it. In my C++ book, they use malloc with other things than void*.
Sirber
24th March 2006, 01:45
Seems I can "walk" memState with heapwalk. is it true?
dimzon
24th March 2006, 01:52
char * memState = (char *) malloc(lStateSize);
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.