This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------ | |
// DecodePipelineData | |
using DecodePipelineCallback = std::function<void(std::shared_ptr<DecodedFrame>)>; | |
struct DecodePipelineData | |
{ | |
// Inputs | |
DecodePipelineCallback Callback; | |
std::shared_ptr<FrameInfo> Input; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void AtExitWrapper() | |
{ | |
spdlog::info("Terminated"); | |
spdlog::shutdown(); | |
} | |
void SetupAsyncDiskLog(const std::string& filename) | |
{ | |
spdlog::init_thread_pool(8192, 1); | |
auto stdout_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** \file | |
\brief Xrcap C# SDK | |
\copyright Copyright (c) 2017 Christopher A. Taylor. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, | |
this list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright notice, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2019 (c) Christopher A. Taylor. All rights reserved. | |
/* | |
Xrcap capture client C API for the RGBD Capture Server. | |
Built on top of CaptureClient.hpp | |
*/ | |
//------------------------------------------------------------------------------ | |
// C Boilerplate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some experiment results from today: | |
(0) Using NVENC directly is much more advantageous than using NvPipe library, which uses it indirectly. | |
(1) NVENC lossless video encode mode does worse than the prior open source lossless library (6-8 Mbps versus 4-5) | |
(2) NVENC only allows for one encoding context at a time, since the second available context must be used for color images. So multiple depth images need to be combined before encoding, or it must be paired with software encoding. Still not sure how to make this practical. | |
(3) Using Zstd for high bits is best done the naive way without any filtering. Tried a few options and found that works best. | |
(4) Rescaling the input data to 0...2047 (as wide as possible) to reduce the impact of low bit errors ends up introducing more high bit errors. | |
(5) Using Zstd for high bits + NVENC for low bits produces files that can be arbitrarily small, in trade for errors in the output. It's hard to judge however the impact of the errors it introduces. If the bandwidth requir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------ | |
// Integer Arithmetic Modulo Mersenne Prime 2^61-1 | |
// p = 2^61 - 1 | |
static const uint64_t kFp61Prime = ((uint64_t)1 << 61) - 1; | |
// x + y (without reduction modulo p) | |
// For x,y < p this can be done up to 7 times (adding 8 values) without overflow | |
static inline uint64_t fp61_add(uint64_t x, uint64_t y) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reduction as in "Generalized Mersenne Numbers" J. Solinas (NSA). | |
Prime from "Solinas primes of small weight for fixed sizes" J. Angel. | |
Fp = 2^64-2^32+1 | |
t = 2^32 | |
d = 2 | |
f(t) = t^2 - c_1 * t - c_2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
// Convolutional encoder: | |
s = a * x + b * y; | |
t = c * x + d * y; | |
The problem with this one is that the "ezc" number of low bit zeros in e is also a number of additional bits that must be sent with each recovery word. | |
Specifically in the decoder this line: | |
> uint64_t yr = ei * t >> ezc; | |
So to tolerate ezc = 4 zero bits, we need to make t 4 bits longer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
/* | |
65-bit multiplication of two 64-bit values a, b | |
with low bits set to 1 (implicitly): | |
(2a + 1)(2b + 1) | |
= 4ab + 2a + 2b + 1 | |
Stuffing it back into a 64-bit value: |