comparison libmpcodecs/vf_stereo3d.c @ 33789:475d96f700d4

Half-width side-by-side formats for stereo3d. Patch by Steaphan Greene [sgreene cs.binghamton.edu]
author reimar
date Mon, 11 Jul 2011 21:54:53 +0000
parents 042b10b477fa
children c24d1a0c7665
comparison
equal deleted inserted replaced
33788:03b638e2b994 33789:475d96f700d4
50 ANAGLYPH_YB_COLOR, //anaglyph yellow/blue colored 50 ANAGLYPH_YB_COLOR, //anaglyph yellow/blue colored
51 MONO_L, //mono output for debugging (left eye only) 51 MONO_L, //mono output for debugging (left eye only)
52 MONO_R, //mono output for debugging (right eye only) 52 MONO_R, //mono output for debugging (right eye only)
53 SIDE_BY_SIDE_LR, //side by side parallel (left eye left, right eye right) 53 SIDE_BY_SIDE_LR, //side by side parallel (left eye left, right eye right)
54 SIDE_BY_SIDE_RL, //side by side crosseye (right eye left, left eye right) 54 SIDE_BY_SIDE_RL, //side by side crosseye (right eye left, left eye right)
55 SIDE_BY_SIDE_2_LR, //side by side parallel with half width resolution
56 SIDE_BY_SIDE_2_RL, //side by side crosseye with half width resolution
55 ABOVE_BELOW_LR, //above-below (left eye above, right eye below) 57 ABOVE_BELOW_LR, //above-below (left eye above, right eye below)
56 ABOVE_BELOW_RL, //above-below (right eye above, left eye below) 58 ABOVE_BELOW_RL, //above-below (right eye above, left eye below)
57 ABOVE_BELOW_2_LR, //above-below with half height resolution 59 ABOVE_BELOW_2_LR, //above-below with half height resolution
58 ABOVE_BELOW_2_RL, //above-below with half height resolution 60 ABOVE_BELOW_2_RL, //above-below with half height resolution
59 INTERLEAVE_ROWS_LR, //row-interleave (left eye has top row) 61 INTERLEAVE_ROWS_LR, //row-interleave (left eye has top row)
146 vf->priv->in.row_left = 0; 148 vf->priv->in.row_left = 0;
147 vf->priv->in.row_right = 0; 149 vf->priv->in.row_right = 0;
148 150
149 //check input format 151 //check input format
150 switch (vf->priv->in.fmt) { 152 switch (vf->priv->in.fmt) {
153 case SIDE_BY_SIDE_2_LR:
154 d_width *= 2;
151 case SIDE_BY_SIDE_LR: 155 case SIDE_BY_SIDE_LR:
152 vf->priv->width = width / 2; 156 vf->priv->width = width / 2;
153 vf->priv->in.off_right = vf->priv->width * 3; 157 vf->priv->in.off_right = vf->priv->width * 3;
154 break; 158 break;
159 case SIDE_BY_SIDE_2_RL:
160 d_width *= 2;
155 case SIDE_BY_SIDE_RL: 161 case SIDE_BY_SIDE_RL:
156 vf->priv->width = width / 2; 162 vf->priv->width = width / 2;
157 vf->priv->in.off_left = vf->priv->width * 3; 163 vf->priv->in.off_left = vf->priv->width * 3;
158 break; 164 break;
159 case ABOVE_BELOW_2_LR: 165 case ABOVE_BELOW_2_LR:
195 case ANAGLYPH_YB_HALF: 201 case ANAGLYPH_YB_HALF:
196 case ANAGLYPH_YB_COLOR: 202 case ANAGLYPH_YB_COLOR:
197 memcpy(vf->priv->ana_matrix, ana_coeff[vf->priv->out.fmt], 203 memcpy(vf->priv->ana_matrix, ana_coeff[vf->priv->out.fmt],
198 sizeof(vf->priv->ana_matrix)); 204 sizeof(vf->priv->ana_matrix));
199 break; 205 break;
206 case SIDE_BY_SIDE_2_LR:
207 d_width /= 2;
200 case SIDE_BY_SIDE_LR: 208 case SIDE_BY_SIDE_LR:
201 vf->priv->out.width = vf->priv->width * 2; 209 vf->priv->out.width = vf->priv->width * 2;
202 vf->priv->out.off_right = vf->priv->width * 3; 210 vf->priv->out.off_right = vf->priv->width * 3;
203 break; 211 break;
212 case SIDE_BY_SIDE_2_RL:
213 d_width /= 2;
204 case SIDE_BY_SIDE_RL: 214 case SIDE_BY_SIDE_RL:
205 vf->priv->out.width = vf->priv->width * 2; 215 vf->priv->out.width = vf->priv->width * 2;
206 vf->priv->out.off_left = vf->priv->width * 3; 216 vf->priv->out.off_left = vf->priv->width * 3;
207 break; 217 break;
208 case ABOVE_BELOW_2_LR: 218 case ABOVE_BELOW_2_LR:
272 vf->priv->out.off_right; 282 vf->priv->out.off_right;
273 283
274 switch (vf->priv->out.fmt) { 284 switch (vf->priv->out.fmt) {
275 case SIDE_BY_SIDE_LR: 285 case SIDE_BY_SIDE_LR:
276 case SIDE_BY_SIDE_RL: 286 case SIDE_BY_SIDE_RL:
287 case SIDE_BY_SIDE_2_LR:
288 case SIDE_BY_SIDE_2_RL:
277 case ABOVE_BELOW_LR: 289 case ABOVE_BELOW_LR:
278 case ABOVE_BELOW_RL: 290 case ABOVE_BELOW_RL:
279 case ABOVE_BELOW_2_LR: 291 case ABOVE_BELOW_2_LR:
280 case ABOVE_BELOW_2_RL: 292 case ABOVE_BELOW_2_RL:
281 case INTERLEAVE_ROWS_LR: 293 case INTERLEAVE_ROWS_LR:
405 {"mono_right", MONO_R}, 417 {"mono_right", MONO_R},
406 {"sbsl", SIDE_BY_SIDE_LR}, 418 {"sbsl", SIDE_BY_SIDE_LR},
407 {"side_by_side_left_first", SIDE_BY_SIDE_LR}, 419 {"side_by_side_left_first", SIDE_BY_SIDE_LR},
408 {"sbsr", SIDE_BY_SIDE_RL}, 420 {"sbsr", SIDE_BY_SIDE_RL},
409 {"side_by_side_right_first", SIDE_BY_SIDE_RL}, 421 {"side_by_side_right_first", SIDE_BY_SIDE_RL},
422 {"sbs2l", SIDE_BY_SIDE_2_LR},
423 {"side_by_side_half_width_left_first", SIDE_BY_SIDE_2_LR},
424 {"sbs2r", SIDE_BY_SIDE_2_RL},
425 {"side_by_side_half_width_right_first",SIDE_BY_SIDE_2_RL},
410 {"abl", ABOVE_BELOW_LR}, 426 {"abl", ABOVE_BELOW_LR},
411 {"above_below_left_first", ABOVE_BELOW_LR}, 427 {"above_below_left_first", ABOVE_BELOW_LR},
412 {"abr", ABOVE_BELOW_RL}, 428 {"abr", ABOVE_BELOW_RL},
413 {"above_below_right_first", ABOVE_BELOW_RL}, 429 {"above_below_right_first", ABOVE_BELOW_RL},
414 {"ab2l", ABOVE_BELOW_2_LR}, 430 {"ab2l", ABOVE_BELOW_2_LR},