Bugzilla – Bug 155889
libdv reorder_block() incorrect for !ARCH_X86 && !ARCH_X86_64
Last modified: 2006-03-10 18:22:12 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 }
Created attachment 71641 [details] Fix libdv reorder_block() on non-x86 Patch as submitted to libdv-dev@lists.sourceforge.net
Sorry for the bad pasting in the original bug report. See the attachment for a non-mangled patch.
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