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> |
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 |
#include <mutex> | |
#include <condition_variable> | |
// binary semaphore | |
class binsem { | |
public: | |
explicit binsem(int init_count = count_max) | |
: count_(init_count) {} | |
// P-operation / acquire |
package jp.yohhoy.hevcdec; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.media.MediaCodec; | |
import android.media.MediaFormat; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.util.Size; | |
import android.view.Surface; |
#include <cassert> | |
#include <concepts> | |
#include <span> | |
#include <tuple> | |
#include <utility> | |
#include <ranges> | |
#if 1 | |
#include <https://raw.githubusercontent.com/kokkos/mdspan/single-header/mdspan.hpp> | |
#else | |
#include <mdspan> |
/* | |
* Convert from OpenCV image and write movie with FFmpeg | |
* | |
* Copyright (c) 2021 yohhoy | |
*/ | |
#include <iostream> | |
#include <vector> | |
// FFmpeg | |
extern "C" { | |
#include <libavformat/avformat.h> |
/* | |
* 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_ | |
#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> |
/* | |
* Convert from OpenCV image and write movie with FFmpeg | |
* | |
* Copyright (c) 2016 yohhoy | |
*/ | |
#include <iostream> | |
#include <vector> | |
// FFmpeg | |
extern "C" { | |
#include <libavformat/avformat.h> |