summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorRonaldo Moura <ronaldo.moura@monity.com.br>2010-05-21 18:05:38 +0000
committerReinhard Tartler <siretart@tauware.de>2010-05-21 18:05:38 +0000
commit37a0852009a863acfa7afd3ab709e590959b70b1 (patch)
tree275a095b7ca25fd50de9a63705b4b9e9e8220014 /libswscale
parentb50601e882a8b77d0c6367bc789afd00695fa1ac (diff)
blackfin: fix yuv422 to yuv420 conversion
The old code is correct only when stride = 2*width. Patch by Ronaldo Moura <ronaldo d moura monity com br> backport r31142 by mru Originally committed as revision 23212 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/bfin/internal_bfin.S17
1 files changed, 12 insertions, 5 deletions
diff --git a/libswscale/bfin/internal_bfin.S b/libswscale/bfin/internal_bfin.S
index 98f69ef53f..5af46540a8 100644
--- a/libswscale/bfin/internal_bfin.S
+++ b/libswscale/bfin/internal_bfin.S
@@ -479,9 +479,6 @@ DEFUN(uyvytoyv12, mL3, (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8
r1 = [fp + ARG_srcStride];
r2 = r0 + r1;
- r1 += -8; // i0,i1 is pre read need to correct
- m0 = r1;
-
i0 = r0; // uyvy_T even
i1 = r2; // uyvy_B odd
@@ -494,6 +491,12 @@ DEFUN(uyvytoyv12, mL3, (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8
p4 = p4 >> 1;
p5 = p5 >> 2;
+ r2 = r0 << 1;
+ r1 = r1 << 1;
+ r1 = r1 - r2; // srcStride + (srcStride - 2*width)
+ r1 += -8; // i0,i1 is pre read need to correct
+ m0 = r1;
+
r2 = [fp + ARG_chromStride];
r0 = r0 >> 1;
r2 = r2 - r0;
@@ -549,8 +552,6 @@ DEFUN(yuyvtoyv12, mL3, (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8
r1 = [fp + ARG_srcStride];
r2 = r0 + r1;
- r1 += -8; // i0,i1 is pre read need to correct
- m0 = r1;
i0 = r0; // uyvy_T even
i1 = r2; // uyvy_B odd
@@ -564,6 +565,12 @@ DEFUN(yuyvtoyv12, mL3, (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8
p4 = p4 >> 1;
p5 = p5 >> 2;
+ r2 = r0 << 1;
+ r1 = r1 << 1;
+ r1 = r1 - r2; // srcStride + (srcStride - 2*width)
+ r1 += -8; // i0,i1 is pre read need to correct
+ m0 = r1;
+
r2 = [fp + ARG_chromStride];
r0 = r0 >> 1;
r2 = r2 - r0;