Mercurial > mplayer.hg
comparison libmpcodecs/vf_scale.c @ 6750:6484f8f9f111
Put back the ordering of the if as requested by Arpi.
author | kmkaplan |
---|---|
date | Thu, 18 Jul 2002 16:14:27 +0000 |
parents | 0e2b14e606ac |
children | 713182435a76 |
comparison
equal
deleted
inserted
replaced
6749:7f619a5d6eb8 | 6750:6484f8f9f111 |
---|---|
105 // calculate the missing parameters: | 105 // calculate the missing parameters: |
106 switch(best) { | 106 switch(best) { |
107 case IMGFMT_YUY2: /* YUY2 needs w rounded to 2 */ | 107 case IMGFMT_YUY2: /* YUY2 needs w rounded to 2 */ |
108 if(vf->priv->w==-3) vf->priv->w=(vf->priv->h*width/height+1)&~1; else | 108 if(vf->priv->w==-3) vf->priv->w=(vf->priv->h*width/height+1)&~1; else |
109 if(vf->priv->w==-2) vf->priv->w=(vf->priv->h*d_width/d_height+1)&~1; | 109 if(vf->priv->w==-2) vf->priv->w=(vf->priv->h*d_width/d_height+1)&~1; |
110 if(vf->priv->w<0) vf->priv->w=width; else | |
111 if(vf->priv->w==0) vf->priv->w=d_width; | |
110 if(vf->priv->h==-3) vf->priv->h=vf->priv->w*height/width; else | 112 if(vf->priv->h==-3) vf->priv->h=vf->priv->w*height/width; else |
111 if(vf->priv->h==-2) vf->priv->h=vf->priv->w*d_height/d_width; | 113 if(vf->priv->h==-2) vf->priv->h=vf->priv->w*d_height/d_width; |
112 break; | 114 break; |
113 case IMGFMT_YV12: /* YV12 needs w & h rounded to 2 */ | 115 case IMGFMT_YV12: /* YV12 needs w & h rounded to 2 */ |
114 if(vf->priv->w==-3) vf->priv->w=(vf->priv->h*width/height+1)&~1; else | 116 if(vf->priv->w==-3) vf->priv->w=(vf->priv->h*width/height+1)&~1; else |
115 if(vf->priv->w==-2) vf->priv->w=(vf->priv->h*d_width/d_height+1)&~1; | 117 if(vf->priv->w==-2) vf->priv->w=(vf->priv->h*d_width/d_height+1)&~1; |
118 if(vf->priv->w<0) vf->priv->w=width; else | |
119 if(vf->priv->w==0) vf->priv->w=d_width; | |
116 if(vf->priv->h==-3) vf->priv->h=(vf->priv->w*height/width+1)&~1; else | 120 if(vf->priv->h==-3) vf->priv->h=(vf->priv->w*height/width+1)&~1; else |
117 if(vf->priv->h==-2) vf->priv->h=(vf->priv->w*d_height/d_width+2)&~1; | 121 if(vf->priv->h==-2) vf->priv->h=(vf->priv->w*d_height/d_width+2)&~1; |
118 break; | 122 break; |
119 default: | 123 default: |
120 if(vf->priv->w==-3) vf->priv->w=vf->priv->h*width/height; else | 124 if(vf->priv->w==-3) vf->priv->w=vf->priv->h*width/height; else |
121 if(vf->priv->w==-2) vf->priv->w=vf->priv->h*d_width/d_height; | 125 if(vf->priv->w==-2) vf->priv->w=vf->priv->h*d_width/d_height; |
126 if(vf->priv->w<0) vf->priv->w=width; else | |
127 if(vf->priv->w==0) vf->priv->w=d_width; | |
122 if(vf->priv->h==-3) vf->priv->h=vf->priv->w*height/width; else | 128 if(vf->priv->h==-3) vf->priv->h=vf->priv->w*height/width; else |
123 if(vf->priv->h==-2) vf->priv->h=vf->priv->w*d_height/d_width; | 129 if(vf->priv->h==-2) vf->priv->h=vf->priv->w*d_height/d_width; |
124 break; | 130 break; |
125 } | 131 } |
126 if(vf->priv->w<0) vf->priv->w=width; else | |
127 if(vf->priv->w==0) vf->priv->w=d_width; | |
128 | 132 |
129 if(vf->priv->h<0) vf->priv->h=height; else | 133 if(vf->priv->h<0) vf->priv->h=height; else |
130 if(vf->priv->h==0) vf->priv->h=d_height; | 134 if(vf->priv->h==0) vf->priv->h=d_height; |
131 | 135 |
132 mp_msg(MSGT_VFILTER,MSGL_DBG2,"SwScale: scaling %dx%d %s to %dx%d %s \n", | 136 mp_msg(MSGT_VFILTER,MSGL_DBG2,"SwScale: scaling %dx%d %s to %dx%d %s \n", |