Mercurial > mplayer.hg
annotate libmpcodecs/vf_hue.c @ 32714:5248e989612a
Remove libswscale subdirectory.
libswscale has been moved to FFmpeg since some time and only kept in the
MPlayer repository for historical reasons and difficulty in moving code
complete with history between Subversion repositories.
FFmpeg now contains libswscale directly without indirection through an
svn:externals property, so no reason to keep libswscale in MPlayer remains.
author | diego |
---|---|
date | Thu, 20 Jan 2011 09:41:43 +0000 |
parents | 7af3e6f901fd |
children |
rev | line source |
---|---|
30421
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
1 /* |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
2 * This file is part of MPlayer. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
3 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
7 * (at your option) any later version. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
8 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
12 * GNU General Public License for more details. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
13 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
17 */ |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29903
diff
changeset
|
18 |
11249 | 19 #include <stdio.h> |
20 #include <stdlib.h> | |
21 #include <string.h> | |
22 #include <inttypes.h> | |
23 #include <math.h> | |
24 | |
17012 | 25 #include "config.h" |
26 #include "mp_msg.h" | |
27 #include "cpudetect.h" | |
11249 | 28 |
29 #include "img_format.h" | |
30 #include "mp_image.h" | |
31 #include "vf.h" | |
32 | |
17012 | 33 #include "libvo/video_out.h" |
11249 | 34 |
35 #include "m_option.h" | |
36 #include "m_struct.h" | |
37 | |
38 static struct vf_priv_s { | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
39 uint8_t *buf[2]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
40 float hue; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
41 float saturation; |
22027 | 42 } const vf_priv_dflt = { |
11249 | 43 {NULL, NULL}, |
44 0.0, | |
45 1.0, | |
46 }; | |
47 | |
48 static void process_C(uint8_t *udst, uint8_t *vdst, uint8_t *usrc, uint8_t *vsrc, int dststride, int srcstride, | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
49 int w, int h, float hue, float sat) |
11249 | 50 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
51 int i; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
52 const int s= rint(sin(hue) * (1<<16) * sat); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
53 const int c= rint(cos(hue) * (1<<16) * sat); |
11249 | 54 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
55 while (h--) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
56 for (i = 0; i<w; i++) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
57 { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
58 const int u= usrc[i] - 128; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
59 const int v= vsrc[i] - 128; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
60 int new_u= (c*u - s*v + (1<<15) + (128<<16))>>16; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
61 int new_v= (s*u + c*v + (1<<15) + (128<<16))>>16; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
62 if(new_u & 768) new_u= (-new_u)>>31; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
63 if(new_v & 768) new_v= (-new_v)>>31; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
64 udst[i]= new_u; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
65 vdst[i]= new_v; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
66 } |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
67 usrc += srcstride; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
68 vsrc += srcstride; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
69 udst += dststride; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
70 vdst += dststride; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
71 } |
11249 | 72 } |
73 | |
74 static void (*process)(uint8_t *udst, uint8_t *vdst, uint8_t *usrc, uint8_t *vsrc, int dststride, int srcstride, | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
75 int w, int h, float hue, float sat); |
11249 | 76 |
77 /* FIXME: add packed yuv version of process */ | |
78 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
79 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) |
11249 | 80 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
81 mp_image_t *dmpi; |
11249 | 82 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
83 dmpi=vf_get_image(vf->next, mpi->imgfmt, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
84 MP_IMGTYPE_EXPORT, 0, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
85 mpi->w, mpi->h); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28628
diff
changeset
|
86 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
87 dmpi->planes[0] = mpi->planes[0]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
88 dmpi->stride[0] = mpi->stride[0]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
89 dmpi->stride[1] = mpi->stride[1]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
90 dmpi->stride[2] = mpi->stride[2]; |
11249 | 91 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
92 if (!vf->priv->buf[0]){ |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
93 vf->priv->buf[0] = malloc(mpi->stride[1]*mpi->h >> mpi->chroma_y_shift); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
94 vf->priv->buf[1] = malloc(mpi->stride[2]*mpi->h >> mpi->chroma_y_shift); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
95 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28628
diff
changeset
|
96 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
97 if (vf->priv->hue == 0 && vf->priv->saturation == 1){ |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
98 dmpi->planes[1] = mpi->planes[1]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
99 dmpi->planes[2] = mpi->planes[2]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
100 }else { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
101 dmpi->planes[1] = vf->priv->buf[0]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
102 dmpi->planes[2] = vf->priv->buf[1]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
103 process(dmpi->planes[1], dmpi->planes[2], |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
104 mpi->planes[1], mpi->planes[2], |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
105 dmpi->stride[1],mpi->stride[1], |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
106 mpi->w>> mpi->chroma_x_shift, mpi->h>> mpi->chroma_y_shift, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
107 vf->priv->hue, vf->priv->saturation); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
108 } |
11249 | 109 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
110 return vf_next_put_image(vf,dmpi, pts); |
11249 | 111 } |
112 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
113 static int control(struct vf_instance *vf, int request, void* data) |
11249 | 114 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
115 vf_equalizer_t *eq; |
11249 | 116 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
117 switch (request) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
118 case VFCTRL_SET_EQUALIZER: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
119 eq = data; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
120 if (!strcmp(eq->item,"hue")) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
121 vf->priv->hue = eq->value * M_PI / 100; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
122 return CONTROL_TRUE; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
123 } else if (!strcmp(eq->item,"saturation")) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
124 vf->priv->saturation = (eq->value + 100)/100.0; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
125 return CONTROL_TRUE; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
126 } |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
127 break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
128 case VFCTRL_GET_EQUALIZER: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
129 eq = data; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
130 if (!strcmp(eq->item,"hue")) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
131 eq->value = rint(vf->priv->hue *100 / M_PI); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
132 return CONTROL_TRUE; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
133 }else if (!strcmp(eq->item,"saturation")) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
134 eq->value = rint(vf->priv->saturation*100 - 100); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
135 return CONTROL_TRUE; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
136 } |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
137 break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
138 } |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
139 return vf_next_control(vf, request, data); |
11249 | 140 } |
141 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
142 static int query_format(struct vf_instance *vf, unsigned int fmt) |
11249 | 143 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
144 switch (fmt) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
145 case IMGFMT_YVU9: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
146 case IMGFMT_IF09: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
147 case IMGFMT_YV12: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
148 case IMGFMT_I420: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
149 case IMGFMT_IYUV: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
150 case IMGFMT_CLPL: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
151 case IMGFMT_444P: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
152 case IMGFMT_422P: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
153 case IMGFMT_411P: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
154 return vf_next_query_format(vf, fmt); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
155 } |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
156 return 0; |
11249 | 157 } |
158 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
159 static void uninit(struct vf_instance *vf) |
11249 | 160 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
161 free(vf->priv->buf[0]); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
162 free(vf->priv->buf[1]); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
163 free(vf->priv); |
11249 | 164 } |
165 | |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
30633
diff
changeset
|
166 static int vf_open(vf_instance_t *vf, char *args) |
11249 | 167 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
168 vf->control=control; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
169 vf->query_format=query_format; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
170 vf->put_image=put_image; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
171 vf->uninit=uninit; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28628
diff
changeset
|
172 |
11249 | 173 vf->priv->hue *= M_PI / 180.0; |
174 | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
175 process = process_C; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
176 return 1; |
11249 | 177 } |
178 | |
179 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f) | |
30707 | 180 static const m_option_t vf_opts_fields[] = { |
11249 | 181 {"hue", ST_OFF(hue), CONF_TYPE_FLOAT, M_OPT_RANGE,-180.0 ,180.0, NULL}, |
182 {"saturation", ST_OFF(saturation), CONF_TYPE_FLOAT, M_OPT_RANGE,-10.0 ,10.0, NULL}, | |
183 { NULL, NULL, 0, 0, 0, 0, NULL } | |
184 }; | |
185 | |
30707 | 186 static const m_struct_t vf_opts = { |
11249 | 187 "hue", |
188 sizeof(struct vf_priv_s), | |
189 &vf_priv_dflt, | |
190 vf_opts_fields | |
191 }; | |
192 | |
25221 | 193 const vf_info_t vf_info_hue = { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
194 "hue changer", |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
195 "hue", |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
196 "Michael Niedermayer", |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
197 "", |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
198 vf_open, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
32537
diff
changeset
|
199 &vf_opts |
11249 | 200 }; |