Bug 155889 - libdv reorder_block() incorrect for !ARCH_X86 && !ARCH_X86_64
Summary: libdv reorder_block() incorrect for !ARCH_X86 && !ARCH_X86_64
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Other (show other bugs)
Version: Beta 3
Hardware: IA64 SuSE Linux 10.1
: P5 - None : Normal (vote)
Target Milestone: Beta 8
Assignee: Bernhard Kaindl
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-07 20:51 UTC by Brent Casavant
Modified: 2006-03-10 18:22 UTC (History)
0 users

See Also:
Found By: Third Party Developer/Partner
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Fix libdv reorder_block() on non-x86 (623 bytes, patch)
2006-03-07 21:01 UTC, Brent Casavant
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Casavant 2006-03-07 20:51:38 UTC
I submitted the following patch to libdv-devel@lists.sourceforge.net, and it is currently pending acceptance.

Subject: [libdv-dev] [PATCH] Fix reorder_block() zigzag on non-x86

The reorder_block() zigzag behaves incorrectly in the !ARCH_X86 &&
!ARCH_X86_64 case.  The current code fails to take into account the
effects of _dv_prepare_reorder_tables(), which changes the indexes
contained in the reorder_88[] and reorder_248[] arrays.

---

Restore older, known good, reorder_block() inner loop.

 encode.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff -ru libdv-0.104-orig/libdv/encode.c libdv-0.104-fixed/libdv/encode.c
--- libdv-0.104-orig/libdv/encode.c     2004-11-16 21:36:30.000000000 -0600
+++ libdv-0.104-fixed/libdv/encode.c    2006-03-07 14:07:22.000000000 -0600
@@ -512,10 +512,9 @@
        _dv_reorder_block_mmx_x86_64(bl->coeffs, reorder);
        emms();
 #else
-       for (i = 0; i < 64; i++) {
-         //            *(unsigned short*) ((char*) zigzag +
reorder[i])=bl->coeffs[i];
-         zigzag[reorder[i] - 1] = bl->coeffs[i];
-       }
+       for (i = 0; i < 64; i++)
+         *(unsigned short*) ((char*) zigzag + reorder[i])=bl->coeffs[i];
+
        memcpy(bl->coeffs, zigzag, 64 * sizeof(dv_coeff_t));
 #endif
 }
Comment 1 Brent Casavant 2006-03-07 21:01:07 UTC
Created attachment 71641 [details]
Fix libdv reorder_block() on non-x86

Patch as submitted to libdv-dev@lists.sourceforge.net
Comment 2 Brent Casavant 2006-03-07 21:02:20 UTC
Sorry for the bad pasting in the original bug report.  See the attachment for a non-mangled patch.
Comment 3 Bernhard Kaindl 2006-03-10 18:22:12 UTC
Thanks, fix is in the repository. It will be included in Beta8.

+* Thu Mar 09 2006 - bk@suse.de
+- Fix reorder_block() on non-x86 (Brent Casavant, SGI) (#155889),
+  restores the older, known good non-x86 loop (no change on x86*)

Using the attachment of this bug:
+Patch3:         non_x86-reorder_block.patch
+%patch3 -p1