Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2006 20:58:03 GMT
From:      Brent Casavant <bcasavan@sgi.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/94188: libdv reorder_block() incorrect on non-x86
Message-ID:  <200603072058.k27Kw3P1062092@www.freebsd.org>
Resent-Message-ID: <200603072100.k27L0F8X061969@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603072058.k27Kw3P1062092>