Basic Theora support working, added a function to the dtsc lib.

This commit is contained in:
Erik Zandvliet 2013-06-25 16:03:36 +02:00
parent a2f088ad80
commit f88bee5baf
6 changed files with 90 additions and 13 deletions

View file

@ -203,6 +203,13 @@ namespace theora{
return commentLen(offset);
}
char header::getLFLIMS(size_t index){
if (getHeaderType() != 2){return 0;}
if (index >= 64){return 0;}
char NBITS = (data[0] >> 5) & 0x07;
return NBITS;
}
std::string header::getUserComment(size_t index){
if (index >= getNComments()){return "";}
int len;
@ -244,6 +251,8 @@ namespace theora{
result << std::string(indent+4,' ') << "[" << i << "] " << getUserComment(i) << std::endl;
}
break;
case 2:
result << std::string(indent+2,' ') << "NBITS: " << (int)getLFLIMS(0) << std::endl;
}
return result.str();
}
@ -296,6 +305,14 @@ namespace theora{
return 0;
}
long long unsigned int header::parseGranuleUpper(long long unsigned int granPos){
return granPos >> getKFGShift();
}
long long unsigned int header::parseGranuleLower(long long unsigned int granPos){
return (granPos & ((1 << getKFGShift()) - 1));
}
std::string frame::toPrettyString(size_t indent){
std::stringstream result;
result << std::string(indent,' ') << "Theora Frame" << std::endl;