Y = a * R + b * G + c * B
Cb = (B - Y) / d
Cr = (R - Y) / e
BT.601 | BT.709 | BT.2020 | |
---|---|---|---|
a | 0.299 | 0.2126 | 0.2627 |
b | 0.587 | 0.7152 | 0.6780 |
/* | |
* Convert from OpenCV image and write movie with FFmpeg | |
* | |
* Copyright (c) 2016 yohhoy | |
*/ | |
#include <iostream> | |
#include <vector> | |
// FFmpeg | |
extern "C" { | |
#include <libavformat/avformat.h> |
#include <cassert> | |
#include <bit> | |
#include <iostream> | |
#include <utility> | |
#if 1 | |
#include <https://raw.githubusercontent.com/kokkos/mdspan/single-header/mdspan.hpp> | |
using std::experimental::mdspan; | |
using std::experimental::dextents; | |
#else | |
#include <mdspan> |
#include <cassert> | |
#include <array> | |
#include <span> | |
#if 1 | |
#include <https://raw.githubusercontent.com/kokkos/mdspan/single-header/mdspan.hpp> | |
using namespace std::experimental; | |
#else | |
#include <mdspan> | |
using namespace std; | |
#endif |
/* | |
* C11 <threads.h> emulation library | |
* | |
* (C) Copyright yohhoy 2012. | |
* Distributed under the Boost Software License, Version 1.0. | |
* (See copy at http://www.boost.org/LICENSE_1_0.txt) | |
*/ | |
#ifndef EMULATED_THREADS_H_INCLUDED_ | |
#define EMULATED_THREADS_H_INCLUDED_ |
Y = a * R + b * G + c * B
Cb = (B - Y) / d
Cr = (R - Y) / e
BT.601 | BT.709 | BT.2020 | |
---|---|---|---|
a | 0.299 | 0.2126 | 0.2627 |
b | 0.587 | 0.7152 | 0.6780 |
/* | |
* 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) 2021 yohhoy | |
*/ | |
#include <iostream> | |
#include <vector> | |
// FFmpeg | |
extern "C" { | |
#include <libavformat/avformat.h> |
https://www.ffmpeg.org/doxygen/trunk/dump_8c_source.html#l00454
st->avg_frame_rate
st->r_frame_rate
st->time_base
st->codec->time_base
AVStream::avg_frame_rate
Average framerate.
avformat_find_stream_info()
.avformat_write_header()
.// https://groups.google.com/g/golang-nuts/c/Gze1TRtdLdc/m/RoD2AxssDgAJ | |
// http://svr-pes20-cppmem.cl.cam.ac.uk/cppmem/ | |
int main() { | |
int x = 0; | |
atomic_int int y = 0; | |
{{{ { x = 1; | |
y.store(1); | |
x = 1; | |
y.store(1); } | |
||| { y.load().readsvalue(0); |
Full barrier
P: =p0=\ /----\ /=p1=\ /----\ /=
* * * *
C: ----/ \=c0=/ \----/ \=c1=/ \-
Half barrier
P: p0=\--------/=p1=\--------/=