summaryrefslogtreecommitdiff
path: root/video/webm_common.h
blob: cd520702e3173788c0d561a7761df124730941a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// File: webm_common.h
//
//  WebM limits and constants shared among all QuickTime functions
//
//=============================================================================


#ifndef WEBM_COMMON_H
#define WEBM_COMMON_H

#ifdef _WIN32
#pragma once
#endif


// constant that define the bounds of various inputs
static const int	cMinVideoFrameWidth = 16;
static const int	cMinVideoFrameHeight = 16;
static const int	cMaxVideoFrameWidth = 2 * 2048;
static const int	cMaxVideoFrameHeight = 2 * 2048;

static const int	cMinFPS = 1;
static const int	cMaxFPS = 600;

static const float  cMinDuration = 0.016666666f;		// 1/60th second
static const float  cMaxDuration = 3600.0f;				// 1 Hour

static const int	cMinSampleRate = 11025;				// 1/4 CD sample rate
static const int	cMaxSampleRate = 88200;				// 2x CD rate


//-----------------------------------------------------------------------------
// Computes a power of two at least as big as the passed-in number
//-----------------------------------------------------------------------------
static inline int ComputeGreaterPowerOfTwo( int n )
{
	int i = 1;
	while ( i < n )
	{
		i <<= 1;
	}
	return i;
}


#endif	// WEBM_COMMON_H