Ogg optimises.

This commit is contained in:
Oswald Auguste de Bruin 2013-10-18 16:33:42 +02:00 committed by Thulinma
parent d11050db34
commit 3f66afff24
5 changed files with 601 additions and 24 deletions

View file

@ -1,9 +1,22 @@
#pragma once
#include<sys/types.h>
#include<stdint.h>
#include<string>
#include <cmath>
#include <sys/types.h>
#include <stdint.h>
#include <string>
#include <deque>
namespace vorbis{
struct mode{
bool blockFlag;
unsigned short windowType;
unsigned short transformType;
char mapping;
};
inline unsigned int ilog(unsigned int input){
return (std::log(input))/(std::log(2))+1;
}
class header{
public:
header();
@ -19,14 +32,16 @@ namespace vorbis{
char getBlockSize1();
char getFramingFlag();
std::string toPrettyString(size_t indent = 0);
std::deque<mode> readModeDeque(char audioChannels);
protected:
uint32_t getInt32(size_t index);
uint32_t getInt24(size_t index);
uint16_t getInt16(size_t index);
private:
std::deque<mode> modes;
char* data;
unsigned int datasize;
bool checkDataSize(unsigned int size);
bool validate();
};
};
}