ports/94188: libdv reorder_block() incorrect on non-x86

Brent Casavant bcasavan at sgi.com
Tue Mar 7 21:00:16 UTC 2006


>Number:         94188
>Category:       ports
>Synopsis:       libdv reorder_block() incorrect on non-x86
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 07 21:00:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Brent Casavant
>Release:        5.4-RELEASE-p12
>Organization:
Silicon Graphics, Inc.
>Environment:
FreeBSD chenjesu 5.4-RELEASE-p12 FreeBSD 5.4-RELEASE-p12 #17: Mon Mar  6 16:04:57 CST 2006     bcasavan at chenjesu:/usr/obj/usr/src/sys/chenjesu  i386

>Description:
In libdv 0.104, 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.
>How-To-Repeat:
Encode a DV stream on a non-x86 build of libdv.
>Fix:
This is the patch I submitted to libdv-dev at lists.sourceforge.net:

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
 }

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list