ISO/IEC 14496-3, 1.6.2.1 AudioSpecificConfig
AudioSpecificConfig() {
audioObjectType = GetAudioObjectType();
samplingFrequencyIndex; // 4 bslbf
if (samplingFrequencyIndex == 0xf) {
samplingFrequency; // 24 uimsbf
}
#!/usr/bin/env python3 | |
import cv2 | |
import numpy as np | |
import sys | |
def hsv_mask(hsv, h_center, h_range, s_low, v_low): | |
h_low = (h_center - h_range) % 180 | |
h_high = (h_center + h_range) % 180 | |
h, s, v = cv2.split(hsv) |
std::string fmt_ntpts(uint64_t ts) | |
{ | |
// 1970/1/1(UNIT time epoch) - 1900/1/1(NTP timestamp epoch) | |
const uint32_t offset = (24u * 60 * 60) * 25567; | |
time_t t = (ts >> 32) - offset; | |
double d = (ts & 0xffffffff) / (double)(1ULL << 32); | |
char buf[256]; | |
size_t n = std::strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%SZ", std::gmtime(&t)); | |
std::sprintf(buf + n, "%f", d); | |
buf[n] = ' '; // force erase '0' |
/* | |
* Read video frame with FFmpeg and convert to OpenCV image | |
* | |
* Copyright (c) 2016 yohhoy | |
*/ | |
#include <iostream> | |
#include <vector> | |
// FFmpeg | |
extern "C" { | |
#include <libavformat/avformat.h> |
/* | |
* Convert from OpenCV image and write movie with FFmpeg | |
* | |
* Copyright (c) 2016 yohhoy | |
*/ | |
#include <iostream> | |
#include <vector> | |
// FFmpeg | |
extern "C" { | |
#include <libavformat/avformat.h> |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
C++ source text converter for PO3OOrO. | |
Copyright (C) 2016 yohhoy. | |
PO3OORO: Enhancing the C++ Basic Character Set with Standard Character Mappings | |
https://isocpp.org/files/papers/PO3OOrO.pdf | |
Special thanks to http://emojipedia.org/ |
#!/usr/bin/env python3 | |
import cv2 | |
import numpy as np | |
import sys | |
def convert(infile, outfile): | |
src = cv2.imread(infile) | |
params = [int(cv2.IMWRITE_JPEG_QUALITY), 10] | |
_, jpeg = cv2.imencode('.jpg', src, params) | |
img = cv2.imdecode(jpeg, 1) |
#!/bin/bash | |
# "hh:mm:ss" to seconds | |
function hms2sec() { | |
hh=$(( 10#`echo $1 | cut -c 1-2` )) | |
mm=$(( 10#`echo $1 | cut -c 4-5` )) | |
ss=$(( 10#`echo $1 | cut -c 7-8` )) | |
echo $(( $hh * 3600 + $mm * 60 + $ss )) | |
} |
/* | |
* lwbs.hpp - lightweight bitstream parsing library | |
* | |
* Copyright (c) 2016 yohhoy | |
* Distributed under the Boost Software License, Version 1.0. | |
* (See copy at http://www.boost.org/LICENSE_1_0.txt) | |
* | |
* Requirement: | |
* - C++11 support | |
* - (u)int64_t support |
#include <memory> | |
namespace detail { | |
template <typename F> | |
std::shared_ptr<void> set_defer(F f) | |
{ return std::shared_ptr<void>(nullptr, [f](void*){ return f(); }); } | |
} | |
#define SET_DEFER_IMPL2(id_, f_) auto deferobj##id_ = detail::set_defer(f_) | |
#define SET_DEFER_IMPL1(id_, f_) SET_DEFER_IMPL2(id_, f_) |