]> git.videolan.org Git - x264.git/commitdiff
Fix RGB colorspace input
authorAnton Mitrofanov <BugMaster@narod.ru>
Tue, 6 Mar 2012 13:34:02 +0000 (17:34 +0400)
committerJason Garrett-Glaser <jason@x264.com>
Tue, 6 Mar 2012 16:51:01 +0000 (08:51 -0800)
BGR/BGRA input was correct.

common/frame.c

index 46f5514d4368f307a6686959f6ce6864c8438ba6..3e7cca1789329e3ff85069f41af0e72a1b5ab2ba 100644 (file)
@@ -366,9 +366,9 @@ int x264_frame_copy_picture( x264_t *h, x264_frame_t *dst, x264_picture_t *src )
              pix[0] += (h->param.i_height-1) * stride[0];
              stride[0] = -stride[0];
          }
-         int b = i_csp==X264_CSP_RGB ? 2 : 0;
-         h->mc.plane_copy_deinterleave_rgb( dst->plane[1], dst->i_stride[1],
-                                            dst->plane[b], dst->i_stride[b],
+         int b = i_csp==X264_CSP_RGB;
+         h->mc.plane_copy_deinterleave_rgb( dst->plane[1+b], dst->i_stride[1+b],
+                                            dst->plane[0], dst->i_stride[0],
                                             dst->plane[2-b], dst->i_stride[2-b],
                                             (pixel*)pix[0], stride[0]/sizeof(pixel), i_csp==X264_CSP_BGRA ? 4 : 3, h->param.i_width, h->param.i_height );
     }