Hi all-- I tried building the ARM-optimized theora codec from the theorarm- merge-branch, and encountered the following compile and runtime problems before getting something to run. If there is another way to build it, it would be nice to know, but I got the sense that its current state in svn is incomplete. I'm using a gcc cross-compiler for ARM on an x86 Linux PC. After running configure for arm-linux-gcc, I had to make the following mods manually. (1) The assembler .s files in ./lib/arm needed to be converted to gcc- compatible format with arm2gcc.pl script. (2) When turning off ARMV6 and ARM_HAS_NEON switches, the ARMfrag.s files had a misplaced .endif directive that needed to be relocated. (3) The CCASFLAGS options needed to be set to "-Xassembler -Iarm/" to locate dependent .s files for assembly. (4) The ARMstate.c file had a couple mismatched function parameter types which needed fixing. (5) When linking completed, the resulting libtheora.so binary was not able to load due to unresolved symbols. The missing functions were in .s files which were not included in the ./lib makefile object list. (6) Modifying the makefile to assemble the additional .s files yielded a libtheora.so binary which loaded but segfaulted in one of the added functions. (7) The extra functions missing from the original makefile were conditionally linked instead of their C versions based on OC_ARM_ASM define. Undefining OC_ARM_ASM in these C functions and relinking the original set of assembler object files finally yielded a usable library. The resulting libtheora.so was noticeably faster than its C-only version on an ARM926 device, so this would be worthwhile to pursue. If interested I can post patches when I get back to my workstation. However I'd like to avoid any further confusion or unnecessary effort if there's active development in this branch. --Dave Milici
> (4) The ARMstate.c file had a couple mismatched function parameter > types which needed fixing.Of all the steps which needed manual intervention, this one seemed to be the most suspicious. Comments? --- theorarm-merge-branch/lib/arm/ARMstate.c 2010-07-23 17:41:45.000000000 -0700 +++ theorarm-merge-branch.saved/lib/arm/ARMstate.c 2010-07-14 11:43:19.000000000 -0700 @@ -26,7 +26,7 @@ const ptrdiff_t *_fragis, const ptrdiff_t *frag_buf_offs); -static void oc_state_frag_copy_list_arm(const oc_theora_state *_state, +void oc_state_frag_copy_list_arm(const oc_theora_state *_state, const ptrdiff_t *_fragis,ptrdiff_t _nfragis, int _dst_frame,int _src_frame,int _pli){ const ptrdiff_t *frag_buf_offs; @@ -43,7 +43,7 @@ frag_buf_offs); } -void oc_state_loop_filter_frag_rows_arm(const oc_theora_state *_state,signed char*_bv, +void oc_state_loop_filter_frag_rows_arm(const oc_theora_state *_state,int _bv[256], int _refi,int _pli,int _fragy0,int _fragy_end){ const oc_fragment_plane *fplane; const oc_fragment *frags; @@ -83,7 +83,7 @@ nhfrags); } -static void oc_state_frag_recon_arm(const oc_theora_state *_state,ptrdiff_t _fragi, +void oc_state_frag_recon_arm(const oc_theora_state *_state,ptrdiff_t _fragi, int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant){ unsigned char *dst; ptrdiff_t frag_buf_off;
Hi-- I had forgotten about posting any patches, so thanks for pinging me. There were some problems with resolving the ARM assembly functions vs the C functions they were supposed to replace. There were also some runtime crashes with at least one of the replacement decode.c functions, and the makefile omitted the corresponding .s files needed to replace them, so I left them disabled. The speedup on ARM926 is still significant, ~2x avg. Attached is bzipped archive of the patches, plus the install.sh build script we use in our build system with arm-linux-gcc. Don't know if bzip attachment is acceptable on newsgroup, though I'll try updating my post. --DaveM ----- Original Message ---- From: Dave Milici <davemilici at sbcglobal.net> To: theora-dev at xiph.org Sent: Sat, July 31, 2010 10:37:11 AM Subject: RE: [theora-dev] theorarm build> (4) The ARMstate.c file had a couple mismatched function parameter > types which needed fixing.Of all the steps which needed manual intervention, this one seemed to be the most suspicious. Comments? --- theorarm-merge-branch/lib/arm/ARMstate.c 2010-07-23 17:41:45.000000000 -0700 +++ theorarm-merge-branch.saved/lib/arm/ARMstate.c 2010-07-14 11:43:19.000000000 -0700 @@ -26,7 +26,7 @@ const ptrdiff_t *_fragis, const ptrdiff_t *frag_buf_offs); -static void oc_state_frag_copy_list_arm(const oc_theora_state *_state, +void oc_state_frag_copy_list_arm(const oc_theora_state *_state, const ptrdiff_t *_fragis,ptrdiff_t _nfragis, int _dst_frame,int _src_frame,int _pli){ const ptrdiff_t *frag_buf_offs; @@ -43,7 +43,7 @@ frag_buf_offs); } -void oc_state_loop_filter_frag_rows_arm(const oc_theora_state *_state,signed char*_bv, +void oc_state_loop_filter_frag_rows_arm(const oc_theora_state *_state,int _bv[256], int _refi,int _pli,int _fragy0,int _fragy_end){ const oc_fragment_plane *fplane; const oc_fragment *frags; @@ -83,7 +83,7 @@ nhfrags); } -static void oc_state_frag_recon_arm(const oc_theora_state *_state,ptrdiff_t _fragi, +void oc_state_frag_recon_arm(const oc_theora_state *_state,ptrdiff_t _fragi, int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant){ unsigned char *dst; ptrdiff_t frag_buf_off; -------------- next part -------------- A non-text attachment was scrubbed... Name: theorarm.patches.tar.bz2 Type: application/octet-stream Size: 21189 bytes Desc: not available Url : http://lists.xiph.org/pipermail/theora-dev/attachments/20100818/c6994473/attachment-0001.obj