Browse code

avfilter/vf_stereo3d: stop dumping half of data for interleave rows output

Signed-off-by: Paul B Mahol <onemda@gmail.com>

Paul B Mahol authored on 2015/09/06 18:22:43
Showing 1 changed files
... ...
@@ -327,13 +327,6 @@ static int config_output(AVFilterLink *outlink)
327 327
     case ABOVE_BELOW_LR:
328 328
     case ABOVE_BELOW_2_RL:
329 329
     case ABOVE_BELOW_RL:
330
-        if (s->out.format == INTERLEAVE_ROWS_LR ||
331
-            s->out.format == INTERLEAVE_ROWS_RL) {
332
-            if (inlink->h & 3) {
333
-                av_log(ctx, AV_LOG_ERROR, "height must be multiple of 4\n");
334
-                return AVERROR_INVALIDDATA;
335
-            }
336
-        }
337 330
         if (inlink->h & 1) {
338 331
             av_log(ctx, AV_LOG_ERROR, "height must be even\n");
339 332
             return AVERROR_INVALIDDATA;
... ...
@@ -391,9 +384,7 @@ static int config_output(AVFilterLink *outlink)
391 391
             s->in.off_lstep = 1;
392 392
         else
393 393
             s->in.off_rstep = 1;
394
-        if (s->out.format != INTERLEAVE_ROWS_LR &&
395
-            s->out.format != INTERLEAVE_ROWS_RL &&
396
-            s->out.format != CHECKERBOARD_LR &&
394
+        if (s->out.format != CHECKERBOARD_LR &&
397 395
             s->out.format != CHECKERBOARD_RL)
398 396
             s->height   = inlink->h / 2;
399 397
         break;
... ...
@@ -468,16 +459,16 @@ static int config_output(AVFilterLink *outlink)
468 468
         s->out.row_left  = s->height;
469 469
         break;
470 470
     case INTERLEAVE_ROWS_LR:
471
-        s->in.row_step   = 2;
471
+        s->in.row_step   = 1 + (s->in.format == INTERLEAVE_ROWS_RL);
472 472
         s->out.row_step  = 2;
473
-        s->height        = s->height / 2;
473
+        s->out.height    = s->height * 2;
474 474
         s->out.off_rstep = 1;
475 475
         s->in.off_rstep  = s->in.format != INTERLEAVE_ROWS_RL;
476 476
         break;
477 477
     case INTERLEAVE_ROWS_RL:
478
-        s->in.row_step   = 2;
478
+        s->in.row_step   = 1 + (s->in.format == INTERLEAVE_ROWS_LR);
479 479
         s->out.row_step  = 2;
480
-        s->height        = s->height / 2;
480
+        s->out.height    = s->height * 2;
481 481
         s->out.off_lstep = 1;
482 482
         s->in.off_lstep  = s->in.format != INTERLEAVE_ROWS_LR;
483 483
         break;