Beispiel #1
0
int main(int argc, char** argv) {
    QCoreApplication app(argc, argv);
    {
        auto start = usecTimestampNow();
        for (int i = 0; i < 1000; ++i) {
            testPropertyFlags();
            testByteCountCoded<quint8>();
            testByteCountCoded<quint16>();
            testByteCountCoded<quint32>();
            testByteCountCoded<quint64>();
        }
        auto duration = usecTimestampNow() - start;
        qDebug() << duration;

    }
    DependencyManager::set<NodeList>(NodeType::Unassigned);

    QFile file(getTestResourceDir() + "packet.bin");
    if (!file.open(QIODevice::ReadOnly)) return -1;
    QByteArray packet = file.readAll();
    EntityItemPointer item = BoxEntityItem::factory(EntityItemID(), EntityItemProperties());
    ReadBitstreamToTreeParams params;
    params.bitstreamVersion = 33;

    auto start = usecTimestampNow();
    for (int i = 0; i < 1000; ++i) {
        item->readEntityDataFromBuffer(reinterpret_cast<const unsigned char*>(packet.constData()), packet.size(), params);
    }
    float duration = (usecTimestampNow() - start);
    qDebug() << (duration / 1000.0f);
    return 0;
}