Make ACLs work correctly for streams. Try comparing the addresses in
[libav.git] / postproc / swscale.h
CommitLineData
fe8054c0 1/*
5427e242 2 Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at>
fe8054c0
MN
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
3db822b0 18
5427e242
MN
19#ifndef SWSCALE_H
20#define SWSCALE_H
21
22#include "swscale_internal.h" //FIXME HACK REMOVE
23
28bf81c9
MN
24/* values for the flags, the stuff on the command line is different */
25#define SWS_FAST_BILINEAR 1
26#define SWS_BILINEAR 2
27#define SWS_BICUBIC 4
28#define SWS_X 8
ff7ba856 29#define SWS_POINT 0x10
d8863d37 30#define SWS_AREA 0x20
81a571a8 31#define SWS_BICUBLIN 0x40
a86c461c
MN
32#define SWS_GAUSS 0x80
33#define SWS_SINC 0x100
34#define SWS_LANCZOS 0x200
35#define SWS_SPLINE 0x400
1e621b18 36
a86c461c
MN
37#define SWS_SRC_V_CHR_DROP_MASK 0x30000
38#define SWS_SRC_V_CHR_DROP_SHIFT 16
5859233b 39
a86c461c
MN
40#define SWS_PARAM_MASK 0x3FC0000
41#define SWS_PARAM_SHIFT 18
42
43#define SWS_PRINT_INFO 0x1000
44
45//the following 3 flags are not completly implemented
1e621b18 46//internal chrominace subsamling info
985c5133 47#define SWS_FULL_CHR_H_INT 0x2000
1e621b18 48//input subsampling info
985c5133
MN
49#define SWS_FULL_CHR_H_INP 0x4000
50#define SWS_DIRECT_BGR 0x8000
1e621b18 51
c7f822d9 52#define SWS_MAX_REDUCE_CUTOFF 0.002
28bf81c9 53
0481412a
MN
54#define SWS_CS_ITU709 1
55#define SWS_CS_FCC 4
56#define SWS_CS_ITU601 5
57#define SWS_CS_ITU624 5
58#define SWS_CS_SMPTE170M 5
59#define SWS_CS_SMPTE240M 7
60#define SWS_CS_DEFAULT 5
61
77a49659 62
28bf81c9 63
c7f822d9
MN
64// when used for filters they must have an odd number of elements
65// coeffs cannot be shared between vectors
28bf81c9 66typedef struct {
c7f822d9 67 double *coeff;
28bf81c9 68 int length;
c7f822d9
MN
69} SwsVector;
70
71// vectors can be shared
72typedef struct {
73 SwsVector *lumH;
74 SwsVector *lumV;
75 SwsVector *chrH;
76 SwsVector *chrV;
28bf81c9
MN
77} SwsFilter;
78
077ea8a7 79
38858470 80// *** bilinear scaling and yuv->rgb & yuv->yuv conversion of yv12 slices:
3db822b0 81// *** Note: it's called multiple times while decoding a frame, first time y==0
38858470 82// dstbpp == 12 -> yv12 output
28bf81c9
MN
83// will use sws_flags
84void SwScale_YV12slice(unsigned char* src[],int srcStride[], int srcSliceY,
85 int srcSliceH, uint8_t* dst[], int dstStride, int dstbpp,
d1fac6cf 86 int srcW, int srcH, int dstW, int dstH);
28bf81c9
MN
87
88// Obsolete, will be removed soon
89void SwScale_Init();
90
91
92
c7f822d9 93void freeSwsContext(SwsContext *swsContext);
28bf81c9 94
6c7506de 95SwsContext *getSwsContextFromCmdLine(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
28bf81c9
MN
96SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
97 SwsFilter *srcFilter, SwsFilter *dstFilter);
5859233b 98void swsGetFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam);
28bf81c9 99
5427e242
MN
100int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation);
101int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation);
102
c7f822d9 103SwsVector *getGaussianVec(double variance, double quality);
5521b193 104SwsVector *getConstVec(double c, int length);
c7f822d9
MN
105SwsVector *getIdentityVec(void);
106void scaleVec(SwsVector *a, double scalar);
107void normalizeVec(SwsVector *a, double height);
5cebb24b
MN
108void convVec(SwsVector *a, SwsVector *b);
109void addVec(SwsVector *a, SwsVector *b);
110void subVec(SwsVector *a, SwsVector *b);
111void shiftVec(SwsVector *a, int shift);
112SwsVector *cloneVec(SwsVector *a);
c7f822d9
MN
113
114void printVec(SwsVector *a);
115void freeVec(SwsVector *a);
28bf81c9 116
5427e242 117#endif