annotate libmpcodecs/vf_pp.c @ 8021:66c0515d234f

Cleaned up the DXR3 section (lots of old stuff which was no longer true). Updated info on -vop lavc.
author mswitch
date Fri, 01 Nov 2002 10:07:28 +0000
parents 1ab37da5b1da
children fe30880576dc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
1 #include <stdio.h>
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
2 #include <stdlib.h>
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
3 #include <string.h>
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
4 #include <inttypes.h>
7963
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
5 #include <errno.h>
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
6
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
7 #include "../config.h"
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
8 #include "../mp_msg.h"
7972
6d1103afba1c cleanly passing the cpuCaps
michael
parents: 7963
diff changeset
9 #include "../cpudetect.h"
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
10
5607
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5565
diff changeset
11 #include "img_format.h"
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5565
diff changeset
12 #include "mp_image.h"
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
13 #include "vf.h"
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
14
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
15 #include "../postproc/postprocess.h"
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
16
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
17 struct vf_priv_s {
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
18 int pp;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
19 PPMode ppMode[GET_PP_QUALITY_MAX+1];
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
20 void *context;
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
21 mp_image_t *dmpi;
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
22 unsigned int outfmt;
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
23 };
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
24
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
25 //===========================================================================//
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
26
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
27 static int config(struct vf_instance_s* vf,
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
28 int width, int height, int d_width, int d_height,
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
29 unsigned int voflags, unsigned int outfmt){
7985
1ab37da5b1da per context cpuCaps (idea by kabi)
michael
parents: 7972
diff changeset
30 vf->priv->context= pp_get_context(width, height,
1ab37da5b1da per context cpuCaps (idea by kabi)
michael
parents: 7972
diff changeset
31 (gCpuCaps.hasMMX ? PP_CPU_CAPS_MMX : 0)
1ab37da5b1da per context cpuCaps (idea by kabi)
michael
parents: 7972
diff changeset
32 | (gCpuCaps.hasMMX2 ? PP_CPU_CAPS_MMX2 : 0)
1ab37da5b1da per context cpuCaps (idea by kabi)
michael
parents: 7972
diff changeset
33 | (gCpuCaps.has3DNow ? PP_CPU_CAPS_3DNOW : 0)
1ab37da5b1da per context cpuCaps (idea by kabi)
michael
parents: 7972
diff changeset
34 );
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
35
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
36 return vf_next_config(vf,width,height,d_width,d_height,voflags,vf->priv->outfmt);
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
37 }
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
38
7949
0aedfdc5d6ef fixing segfault
michael
parents: 7946
diff changeset
39 static void uninit(struct vf_instance_s* vf){
7961
78e0f2776da7 cosmetics ;)
michael
parents: 7960
diff changeset
40 if(vf->priv->context) pp_free_context(vf->priv->context);
7949
0aedfdc5d6ef fixing segfault
michael
parents: 7946
diff changeset
41 }
0aedfdc5d6ef fixing segfault
michael
parents: 7946
diff changeset
42
5518
04a40454bdbb accept only 4:2:0 planar yuv formats
arpi
parents: 5514
diff changeset
43 static int query_format(struct vf_instance_s* vf, unsigned int fmt){
04a40454bdbb accept only 4:2:0 planar yuv formats
arpi
parents: 5514
diff changeset
44 switch(fmt){
04a40454bdbb accept only 4:2:0 planar yuv formats
arpi
parents: 5514
diff changeset
45 case IMGFMT_YV12:
04a40454bdbb accept only 4:2:0 planar yuv formats
arpi
parents: 5514
diff changeset
46 case IMGFMT_I420:
04a40454bdbb accept only 4:2:0 planar yuv formats
arpi
parents: 5514
diff changeset
47 case IMGFMT_IYUV:
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
48 return vf_next_query_format(vf,vf->priv->outfmt);
5518
04a40454bdbb accept only 4:2:0 planar yuv formats
arpi
parents: 5514
diff changeset
49 }
04a40454bdbb accept only 4:2:0 planar yuv formats
arpi
parents: 5514
diff changeset
50 return 0;
04a40454bdbb accept only 4:2:0 planar yuv formats
arpi
parents: 5514
diff changeset
51 }
04a40454bdbb accept only 4:2:0 planar yuv formats
arpi
parents: 5514
diff changeset
52
5519
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
53 static int control(struct vf_instance_s* vf, int request, void* data){
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
54 switch(request){
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
55 case VFCTRL_QUERY_MAX_PP_LEVEL:
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
56 return GET_PP_QUALITY_MAX;
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
57 case VFCTRL_SET_PP_LEVEL:
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
58 vf->priv->pp= *((unsigned int*)data);
5519
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
59 return CONTROL_TRUE;
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
60 }
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
61 return vf_next_control(vf,request,data);
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
62 }
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
63
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
64 static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
65 if(vf->priv->pp&0xFFFF) return; // non-local filters enabled
5513
73696051e3ce mpeg+pp0 fixed
arpi
parents: 5512
diff changeset
66 if((mpi->type==MP_IMGTYPE_IPB || vf->priv->pp) &&
73696051e3ce mpeg+pp0 fixed
arpi
parents: 5512
diff changeset
67 mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
68 if(!(mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE) && mpi->imgfmt!=vf->priv->outfmt)
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
69 return; // colorspace differ
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
70 // ok, we can do pp in-place (or pp disabled):
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
71 vf->priv->dmpi=vf_get_image(vf->next,mpi->imgfmt,
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
72 mpi->type, mpi->flags, mpi->w, mpi->h);
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
73 mpi->planes[0]=vf->priv->dmpi->planes[0];
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
74 mpi->stride[0]=vf->priv->dmpi->stride[0];
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
75 mpi->width=vf->priv->dmpi->width;
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
76 if(mpi->flags&MP_IMGFLAG_PLANAR){
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
77 mpi->planes[1]=vf->priv->dmpi->planes[1];
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
78 mpi->planes[2]=vf->priv->dmpi->planes[2];
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
79 mpi->stride[1]=vf->priv->dmpi->stride[1];
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
80 mpi->stride[2]=vf->priv->dmpi->stride[2];
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
81 }
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
82 mpi->flags|=MP_IMGFLAG_DIRECT;
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
83 }
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
84
7368
a894e99c1e51 changing return type of put_image void->int
arpi
parents: 7127
diff changeset
85 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
86 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
87 // no DR, so get a new image! hope we'll get DR buffer:
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
88 vf->priv->dmpi=vf_get_image(vf->next,vf->priv->outfmt,
6875
255b150a75a5 - some reorder/cleanup of mp_image flags
arpi
parents: 5607
diff changeset
89 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
255b150a75a5 - some reorder/cleanup of mp_image flags
arpi
parents: 5607
diff changeset
90 // MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
255b150a75a5 - some reorder/cleanup of mp_image flags
arpi
parents: 5607
diff changeset
91 // mpi->w,mpi->h);
255b150a75a5 - some reorder/cleanup of mp_image flags
arpi
parents: 5607
diff changeset
92 (mpi->w+7)&(~7),(mpi->h+7)&(~7));
255b150a75a5 - some reorder/cleanup of mp_image flags
arpi
parents: 5607
diff changeset
93 vf->priv->dmpi->w=mpi->w; vf->priv->dmpi->h=mpi->h; // display w;h
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
94 }
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
95
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
96 if(vf->priv->pp || !(mpi->flags&MP_IMGFLAG_DIRECT)){
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
97 // do the postprocessing! (or copy if no DR)
7961
78e0f2776da7 cosmetics ;)
michael
parents: 7960
diff changeset
98 pp_postprocess(mpi->planes ,mpi->stride,
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
99 vf->priv->dmpi->planes,vf->priv->dmpi->stride,
6875
255b150a75a5 - some reorder/cleanup of mp_image flags
arpi
parents: 5607
diff changeset
100 (mpi->w+7)&(~7),mpi->h,
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
101 mpi->qscale, mpi->qstride,
7960
0a4ab841ae29 better deblocking filter
michael
parents: 7949
diff changeset
102 &vf->priv->ppMode[ vf->priv->pp ], vf->priv->context,
0a4ab841ae29 better deblocking filter
michael
parents: 7949
diff changeset
103 mpi->pict_type);
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
104 }
7368
a894e99c1e51 changing return type of put_image void->int
arpi
parents: 7127
diff changeset
105 return vf_next_put_image(vf,vf->priv->dmpi);
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
106 }
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
107
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
108 //===========================================================================//
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
109
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
110 extern int divx_quality;
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
111
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
112 static unsigned int fmt_list[]={
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
113 IMGFMT_YV12,
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
114 IMGFMT_I420,
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
115 IMGFMT_IYUV,
7127
1e47c2e7aa8e mostly compiler warning fixes, some small bugfix
arpi
parents: 6875
diff changeset
116 0
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
117 };
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
118
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
119 static int open(vf_instance_t *vf, char* args){
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
120 char *endptr, *name;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
121 int i;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
122 int hex_mode=0;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
123
5518
04a40454bdbb accept only 4:2:0 planar yuv formats
arpi
parents: 5514
diff changeset
124 vf->query_format=query_format;
5519
868c13f78f08 vf control codes added, autoq support
arpi
parents: 5518
diff changeset
125 vf->control=control;
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
126 vf->config=config;
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
127 vf->get_image=get_image;
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
128 vf->put_image=put_image;
7949
0aedfdc5d6ef fixing segfault
michael
parents: 7946
diff changeset
129 vf->uninit=uninit;
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
130 vf->default_caps=VFCAP_ACCEPT_STRIDE|VFCAP_POSTPROC;
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
131 vf->priv=malloc(sizeof(struct vf_priv_s));
7949
0aedfdc5d6ef fixing segfault
michael
parents: 7946
diff changeset
132 vf->priv->context=NULL;
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
133
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
134 // check csp:
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
135 vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
136 if(!vf->priv->outfmt) return 0; // no csp match :(
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5519
diff changeset
137
5514
127f2a84e933 accept -pp value from args
arpi
parents: 5513
diff changeset
138 if(args){
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
139 if(!strcmp("help", args)){
7961
78e0f2776da7 cosmetics ;)
michael
parents: 7960
diff changeset
140 printf("%s", pp_help);
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
141 exit(1);
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
142 }
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
143
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
144 hex_mode= strtol(args, &endptr, 0);
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
145 if(*endptr){
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
146 name= args;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
147 }else
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
148 name= NULL;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
149 }else{
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
150 name="de";
5514
127f2a84e933 accept -pp value from args
arpi
parents: 5513
diff changeset
151 }
7972
6d1103afba1c cleanly passing the cpuCaps
michael
parents: 7963
diff changeset
152
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
153 if(name){
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
154 for(i=0; i<=GET_PP_QUALITY_MAX; i++){
7961
78e0f2776da7 cosmetics ;)
michael
parents: 7960
diff changeset
155 vf->priv->ppMode[i]= pp_get_mode_by_name_and_quality(name, i);
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
156 if(vf->priv->ppMode[i].error) return -1;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
157 }
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
158 }else{
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
159 /* hex mode for compatibility */
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
160 for(i=0; i<=GET_PP_QUALITY_MAX; i++){
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
161 PPMode ppMode;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
162
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
163 ppMode.lumMode= hex_mode;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
164 ppMode.chromMode= ((hex_mode&0xFF)>>4) | (hex_mode&0xFFFFFF00);
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
165 ppMode.maxTmpNoise[0]= 700;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
166 ppMode.maxTmpNoise[1]= 1500;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
167 ppMode.maxTmpNoise[2]= 3000;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
168 ppMode.maxAllowedY= 234;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
169 ppMode.minAllowedY= 16;
7960
0a4ab841ae29 better deblocking filter
michael
parents: 7949
diff changeset
170 ppMode.baseDcDiff= 256/4;
7946
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
171 ppMode.flatnessThreshold=40;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
172
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
173 vf->priv->ppMode[i]= ppMode;
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
174 }
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
175 }
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
176
f483ab704252 postprocessing cleanup:
michael
parents: 7368
diff changeset
177 vf->priv->pp=GET_PP_QUALITY_MAX; //divx_quality;
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
178 return 1;
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
179 }
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
180
7963
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
181 int readPPOpt(void *conf, char *arg)
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
182 {
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
183 int val;
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
184
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
185 if(arg == NULL)
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
186 return -2; // ERR_MISSING_PARAM
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
187 errno = 0;
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
188 val = (int)strtol(arg,NULL,0);
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
189 if(errno != 0)
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
190 return -4; // What about include cfgparser.h and use ERR_* defines */
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
191 if(val < 0)
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
192 return -3; // ERR_OUT_OF_RANGE
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
193
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
194 divx_quality = val;
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
195
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
196 return 1;
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
197 }
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
198
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
199 void revertPPOpt(void *conf, char* opt)
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
200 {
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
201 divx_quality=0;
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
202 }
0a5d69e6f2a2 cleanup
michael
parents: 7961
diff changeset
203
5512
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
204 vf_info_t vf_info_pp = {
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
205 "postprocessing",
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
206 "pp",
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
207 "A'rpi",
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
208 "",
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
209 open
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
210 };
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
211
4ccfa77d8e86 postprocessing filter (fixme: -pp 0)
arpi
parents:
diff changeset
212 //===========================================================================//