OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
video.cpp File Reference
#include "video.h"
#include <stdexcept>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <limits>

Go to the source code of this file.

Classes

struct  VLCcode
 
struct  VLC
 
struct  Bink::Video::BitStream
 

Functions

static uint32_t AV_RL32 (const char *v)
 
static int av_log2 (unsigned v)
 
template<class T >
static void idctTransform (T *dest, const int *src, int s0, int s1, int s2, int s3, int s4, int s5, int s6, int s7, int d0, int d1, int d2, int d3, int d4, int d5, int d6, int d7, T(*munge)(int))
 
template<class T >
static void idctCol (T *dest, const int *src)
 
template<class T >
static void idctRow (T *dest, const int *src)
 
static void bink_idct_col (int *dest, const int32_t *src)
 
template<class T >
static void BF (T &x, T &y, const T &a, const T &b)
 
template<class T >
static void CMUL (T &dre, T &dim, const T &are, const T &aim, const T &bre, const T &bim)
 
static void BUTTERFLIES (Video::FFTComplex &a0, Video::FFTComplex &a1, Video::FFTComplex &a2, Video::FFTComplex &a3, float &t1, float &t2, float &t3, float &t4, float &t5, float &t6)
 
static void transform (Video::FFTComplex &a0, Video::FFTComplex &a1, Video::FFTComplex &a2, Video::FFTComplex &a3, const float wre, const float wim, float &t1, float &t2, float &t3, float &t4, float &t5, float &t6)
 
static void transformZero (Video::FFTComplex &a0, Video::FFTComplex &a1, Video::FFTComplex &a2, Video::FFTComplex &a3, float &t1, float &t2, float &t3, float &t4, float &t5, float &t6)
 
static void fftPass (Video::FFTComplex *z, const float *wre, unsigned int n)
 
template<int n, int ord>
static void fft (Video::FFTComplex *z)
 
template<>
void fft< 4, 2 > (Video::FFTComplex *z)
 
template<>
void fft< 8, 3 > (Video::FFTComplex *z)
 
template<>
void fft< 16, 4 > (Video::FFTComplex *z)
 
static int splitRadixPermutation (int i, int n, int inverse)
 
template<class T >
static void processFftPerm (T *revtab, int n, bool inverse)
 

Variables

static const float sqrthalf = std::sqrt(0.5f)
 
static const uint16_t ff_wma_critical_freqs [25]
 
static const uint8_t bink_scan [64]
 
static const uint8_t bink_rlelens [4] = { 4, 8, 12, 32 }
 
static const uint8_t bink_tree_lens [16][16]
 
static const uint8_t bink_patterns [16][64]
 
static const uint32_t bink_intra_quant [16][64]
 
static const uint32_t bink_inter_quant [16][64]
 
static const uint8_t rle_length_tab [16]
 
static VLC bink_trees [16]
 
static std::vector< float > ffCosTabs [18]
 

Function Documentation

◆ av_log2()

static int av_log2 ( unsigned  v)
static

Definition at line 575 of file video.cpp.

◆ AV_RL32()

static uint32_t AV_RL32 ( const char *  v)
static

Definition at line 565 of file video.cpp.

◆ BF()

template<class T >
static void BF ( T &  x,
T &  y,
const T &  a,
const T &  b 
)
static

Definition at line 643 of file video.cpp.

◆ bink_idct_col()

static void bink_idct_col ( int *  dest,
const int32_t *  src 
)
static

Definition at line 627 of file video.cpp.

◆ BUTTERFLIES()

static void BUTTERFLIES ( Video::FFTComplex a0,
Video::FFTComplex a1,
Video::FFTComplex a2,
Video::FFTComplex a3,
float &  t1,
float &  t2,
float &  t3,
float &  t4,
float &  t5,
float &  t6 
)
static

Definition at line 654 of file video.cpp.

◆ CMUL()

template<class T >
static void CMUL ( T &  dre,
T &  dim,
const T &  are,
const T &  aim,
const T &  bre,
const T &  bim 
)
static

Definition at line 649 of file video.cpp.

◆ fft()

template<int n, int ord>
static void fft ( Video::FFTComplex z)
static

Definition at line 700 of file video.cpp.

◆ fft< 16, 4 >()

template<>
void fft< 16, 4 > ( Video::FFTComplex z)

Definition at line 736 of file video.cpp.

◆ fft< 4, 2 >()

template<>
void fft< 4, 2 > ( Video::FFTComplex z)

Definition at line 708 of file video.cpp.

◆ fft< 8, 3 >()

template<>
void fft< 8, 3 > ( Video::FFTComplex z)

Definition at line 722 of file video.cpp.

◆ fftPass()

static void fftPass ( Video::FFTComplex z,
const float *  wre,
unsigned int  n 
)
static

Definition at line 680 of file video.cpp.

◆ idctCol()

template<class T >
static void idctCol ( T *  dest,
const int *  src 
)
static

Definition at line 616 of file video.cpp.

◆ idctRow()

template<class T >
static void idctRow ( T *  dest,
const int *  src 
)
static

Definition at line 622 of file video.cpp.

◆ idctTransform()

template<class T >
static void idctTransform ( T *  dest,
const int *  src,
int  s0,
int  s1,
int  s2,
int  s3,
int  s4,
int  s5,
int  s6,
int  s7,
int  d0,
int  d1,
int  d2,
int  d3,
int  d4,
int  d5,
int  d6,
int  d7,
T(*)(int)  munge 
)
static

Definition at line 580 of file video.cpp.

◆ processFftPerm()

template<class T >
static void processFftPerm ( T *  revtab,
int  n,
bool  inverse 
)
static

Definition at line 1789 of file video.cpp.

◆ splitRadixPermutation()

static int splitRadixPermutation ( int  i,
int  n,
int  inverse 
)
static

Definition at line 1776 of file video.cpp.

◆ transform()

static void transform ( Video::FFTComplex a0,
Video::FFTComplex a1,
Video::FFTComplex a2,
Video::FFTComplex a3,
const float  wre,
const float  wim,
float &  t1,
float &  t2,
float &  t3,
float &  t4,
float &  t5,
float &  t6 
)
static

Definition at line 664 of file video.cpp.

◆ transformZero()

static void transformZero ( Video::FFTComplex a0,
Video::FFTComplex a1,
Video::FFTComplex a2,
Video::FFTComplex a3,
float &  t1,
float &  t2,
float &  t3,
float &  t4,
float &  t5,
float &  t6 
)
static

Definition at line 671 of file video.cpp.

Variable Documentation

◆ bink_inter_quant

const uint32_t bink_inter_quant[16][64]
static

Definition at line 380 of file video.cpp.

◆ bink_intra_quant

const uint32_t bink_intra_quant[16][64]
static

Definition at line 218 of file video.cpp.

◆ bink_patterns

const uint8_t bink_patterns[16][64]
static

Definition at line 56 of file video.cpp.

◆ bink_rlelens

const uint8_t bink_rlelens[4] = { 4, 8, 12, 32 }
static

Definition at line 37 of file video.cpp.

◆ bink_scan

const uint8_t bink_scan[64]
static
Initial value:
= {
0, 1, 8, 9, 2, 3, 10, 11,
4, 5, 12, 13, 6, 7, 14, 15,
20, 21, 28, 29, 22, 23, 30, 31,
16, 17, 24, 25, 32, 33, 40, 41,
34, 35, 42, 43, 48, 49, 56, 57,
50, 51, 58, 59, 18, 19, 26, 27,
36, 37, 44, 45, 38, 39, 46, 47,
52, 53, 60, 61, 54, 55, 62, 63
}

Definition at line 27 of file video.cpp.

◆ bink_tree_lens

const uint8_t bink_tree_lens[16][16]
static
Initial value:
= {
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 },
{ 1, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
{ 2, 2, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
{ 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
{ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5 },
{ 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 },
{ 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5 },
{ 1, 3, 3, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
{ 1, 2, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
{ 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6 },
{ 2, 2, 3, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 },
{ 1, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 },
{ 2, 2, 2, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
{ 1, 3, 3, 3, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7 },
{ 1, 3, 3, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 },
{ 2, 2, 3, 3, 3, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7 },
}

Definition at line 38 of file video.cpp.

◆ bink_trees

VLC bink_trees[16]
static

Definition at line 561 of file video.cpp.

◆ ff_wma_critical_freqs

const uint16_t ff_wma_critical_freqs[25]
static
Initial value:
= {
100, 200, 300, 400, 510, 630, 770, 920,
1080, 1270, 1480, 1720, 2000, 2320, 2700, 3150,
3700, 4400, 5300, 6400, 7700, 9500, 12000, 15500,
24500,
}

Definition at line 19 of file video.cpp.

◆ ffCosTabs

std::vector<float> ffCosTabs[18]
static

Definition at line 563 of file video.cpp.

◆ rle_length_tab

const uint8_t rle_length_tab[16]
static
Initial value:
= {
2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 32, 64
}

Definition at line 542 of file video.cpp.

◆ sqrthalf

const float sqrthalf = std::sqrt(0.5f)
static

Definition at line 17 of file video.cpp.