[theora] experimental patch for libtheora1.1beta3

Vladimir Támara Patiño vtamara at pasosdeJesus.org
Sun Aug 30 05:11:29 PDT 2009


Good morning in the Lord

Regarding the port of libtheora1.1beta3 for OpenBSD for amd64 and the
problem I described at:
http://lists.xiph.org/pipermail/theora/2009-August/002640.html
Attached is a patch for
	libtheora/patches/patch-lib_x86_mmxencfrag_c 

I can play videos with it.  ¿Does it work for you?

Best regards
-- 
Dios, gracias por tu amor infinito.
http://www.primarilypublicdomain.org/letter/
--  
  Vladimir Támara Patiño.  
  http://www.geocities.com/v-tamara


Index: Makefile
===================================================================
RCS file: /cvs/ports/multimedia/libtheora/Makefile,v
retrieving revision 1.10
diff -u Makefile
--- Makefile	12 Feb 2009 03:21:56 -0000	1.10
+++ Makefile	25 Aug 2009 14:46:39 -0000
@@ -2,14 +2,14 @@
 
 COMMENT=	open video codec
 
-DISTNAME=	libtheora-1.0
+DISTNAME=	libtheora-1.1beta3
 CATEGORIES=	multimedia
 MASTER_SITES=	http://downloads.xiph.org/releases/theora/
 EXTRACT_SUFX=	.tar.bz2
 
 SHARED_LIBS+=	theora		3.1
 SHARED_LIBS+=	theoradec	1.0
-SHARED_LIBS+=	theoraenc	1.1
+SHARED_LIBS+=	theoraenc	1.2
 
 HOMEPAGE=	http://www.theora.org/
 
@@ -30,5 +30,8 @@
 CONFIGURE_ARGS=	--disable-examples
 CONFIGURE_ENV=	ac_cv_prog_HAVE_DOXYGEN=false \
 		ac_cv_prog_HAVE_PDFLATEX=false
+
+#MODULES+=       gcc4
+#MODGCC4_ARCHES= *
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/multimedia/libtheora/distinfo,v
retrieving revision 1.6
diff -u distinfo
--- distinfo	12 Feb 2009 03:21:56 -0000	1.6
+++ distinfo	25 Aug 2009 14:46:39 -0000
@@ -1,5 +1,5 @@
-MD5 (libtheora-1.0.tar.bz2) = yWOTcFP0Wnh4lUvtN86xgg==
-RMD160 (libtheora-1.0.tar.bz2) = 9y0KLOhHWoiKtn/Xe3Em1m1TfJs=
-SHA1 (libtheora-1.0.tar.bz2) = AnF3cwAbRPlbxsIxEaiUk6SpP4c=
-SHA256 (libtheora-1.0.tar.bz2) = OunfVuj8df/ibmOhPK4s550HlBYXX7C6/+Di3o3JGm0=
-SIZE (libtheora-1.0.tar.bz2) = 1652987
+MD5 (libtheora-1.1beta3.tar.bz2) = IBKpmX9MciDNpDkRhqB/FQ==
+RMD160 (libtheora-1.1beta3.tar.bz2) = pRtrXNr+ETDuZDnOqOiS83oQtQc=
+SHA1 (libtheora-1.1beta3.tar.bz2) = q8qX5L0sqtiW4cLBNZYmqQM9qLA=
+SHA256 (libtheora-1.1beta3.tar.bz2) = 2HP0wBgfp1tePPBpQzdAsnd4EML9WAVdTmKqrAwjnV4=
+SIZE (libtheora-1.1beta3.tar.bz2) = 1785382
Index: patches/patch-configure
===================================================================
RCS file: /cvs/ports/multimedia/libtheora/patches/patch-configure,v
retrieving revision 1.4
diff -u patches/patch-configure
--- patches/patch-configure	25 Jul 2008 14:20:50 -0000	1.4
+++ patches/patch-configure	25 Aug 2009 14:46:39 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-configure,v 1.4 2008/07/25 14:20:50 brad Exp $
---- configure.orig	Thu Jul 24 13:22:04 2008
-+++ configure	Thu Jul 24 13:23:06 2008
-@@ -19970,8 +19970,8 @@ else
+--- configure.orig	Wed Aug 12 11:58:08 2009
++++ configure	Wed Aug 12 21:42:50 2009
+@@ -11843,8 +11843,8 @@ else
          case $host in
          *)
                  DEBUG="-g -Wall -Wno-parentheses -DDEBUG -D__NO_MATH_INLINES"
Index: patches/patch-doc_Makefile_in
===================================================================
RCS file: /cvs/ports/multimedia/libtheora/patches/patch-doc_Makefile_in,v
retrieving revision 1.3
diff -u patches/patch-doc_Makefile_in
--- patches/patch-doc_Makefile_in	25 Jul 2008 14:20:18 -0000	1.3
+++ patches/patch-doc_Makefile_in	25 Aug 2009 14:46:39 -0000
@@ -1,12 +1,12 @@
 $OpenBSD: patch-doc_Makefile_in,v 1.3 2008/07/25 14:20:18 brad Exp $
---- doc/Makefile.in.orig	Wed Apr 16 16:26:14 2008
-+++ doc/Makefile.in	Tue Jul 15 16:54:48 2008
-@@ -187,7 +187,7 @@ build_vendor = @build_vendor@
- builddir = @builddir@
- datadir = @datadir@
- datarootdir = @datarootdir@
+--- doc/Makefile.in.orig	Wed Aug 12 11:58:08 2009
++++ doc/Makefile.in	Wed Aug 12 21:44:27 2009
+@@ -161,7 +161,7 @@ sys_symbol_underscore = @sys_symbol_underscore@
+ 
+ SUBDIRS = spec
+ 
 -docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
 +docdir = $(datadir)/doc/$(PACKAGE)
- dvidir = @dvidir@
- exec_prefix = @exec_prefix@
- host = @host@
+ 
+ static_docs = vp3-format.txt color.html \
+ 	draft-ietf-avt-rtp-theora-00.xml \
Index: patches/patch-doc_spec_Makefile_in
===================================================================
RCS file: /cvs/ports/multimedia/libtheora/patches/patch-doc_spec_Makefile_in,v
retrieving revision 1.1
diff -u patches/patch-doc_spec_Makefile_in
--- patches/patch-doc_spec_Makefile_in	25 Jul 2008 14:20:50 -0000	1.1
+++ patches/patch-doc_spec_Makefile_in	25 Aug 2009 14:46:39 -0000
@@ -1,12 +1,12 @@
 $OpenBSD: patch-doc_spec_Makefile_in,v 1.1 2008/07/25 14:20:50 brad Exp $
---- doc/spec/Makefile.in.orig	Tue Jul 15 17:48:31 2008
-+++ doc/spec/Makefile.in	Tue Jul 15 17:48:40 2008
-@@ -197,7 +197,7 @@ build_vendor = @build_vendor@
- builddir = @builddir@
- datadir = @datadir@
- datarootdir = @datarootdir@
+--- doc/spec/Makefile.in.orig	Wed Aug 12 11:58:08 2009
++++ doc/spec/Makefile.in	Wed Aug 12 21:47:07 2009
+@@ -162,7 +162,7 @@ ltdl_LIBOBJS = @ltdl_LIBOBJS@
+ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@
+ sys_symbol_underscore = @sys_symbol_underscore@
+ 
 -docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
 +docdir = $(datadir)/doc/$(PACKAGE)
- dvidir = @dvidir@
- exec_prefix = @exec_prefix@
- host = @host@
+ 
+ built_docs = Theora.pdf
+ 
Index: patches/patch-examples_Makefile_in
===================================================================
RCS file: /cvs/ports/multimedia/libtheora/patches/patch-examples_Makefile_in,v
retrieving revision 1.3
diff -u patches/patch-examples_Makefile_in
--- patches/patch-examples_Makefile_in	25 Jul 2008 14:20:18 -0000	1.3
+++ patches/patch-examples_Makefile_in	25 Aug 2009 14:46:39 -0000
@@ -1,17 +1,12 @@
 $OpenBSD: patch-examples_Makefile_in,v 1.3 2008/07/25 14:20:18 brad Exp $
---- examples/Makefile.in.orig	Wed Apr 16 16:26:15 2008
-+++ examples/Makefile.in	Tue Jul 15 17:08:10 2008
-@@ -251,11 +251,11 @@ LDADD = ../lib/libtheora.la $(OGG_LIBS)
- LDADDENC = ../lib/libtheoraenc.la ../lib/libtheoradec.la $(OGG_LIBS)
+--- examples/Makefile.in.orig	Wed Aug 12 11:58:08 2009
++++ examples/Makefile.in	Wed Aug 12 21:46:06 2009
+@@ -173,7 +173,7 @@ LDADDENC = ../lib/libtheoraenc.la ../lib/libtheoradec.
+ 
  dump_video_SOURCES = dump_video.c
  EXTRA_dump_video_SOURCES = getopt.c getopt1.c getopt.h
--dump_video_LDADD = $(GETOPT_OBJS) $(LDADD)
-+dump_video_LDADD = $(GETOPT_OBJS) $(LDADD) -lcompat
- dump_video_DEPENDENCIES = $(GETOPT_OBJS)
- player_example_SOURCES = player_example.c
- player_example_CFLAGS = $(SDL_CFLAGS) $(OGG_CFLAGS) $(VORBIS_CFLAGS)
--player_example_LDADD = $(LDADD) $(SDL_LIBS) $(VORBIS_LIBS)
-+player_example_LDADD = $(LDADD) $(SDL_LIBS) $(VORBIS_LIBS) -lossaudio
- encoder_example_SOURCES = encoder_example.c
- EXTRA_encoder_example_SOURCES = getopt.c getopt1.c getopt.h
- encoder_example_CFLAGS = $(OGG_CFLAGS) $(VORBIS_CFLAGS)
+-dump_video_LDADD = $(GETOPT_OBJS) $(LDADDDEC)
++dump_video_LDADD = $(GETOPT_OBJS) $(LDADDDEC) -lcompat
+ 
+ dump_psnr_SOURCES = dump_psnr.c
+ EXTRA_dump_psnr_SOURCES = getopt.c getopt1.c getopt.h
? patches/patch-lib_x86_mmxencfrag_c

$OpenBSD$
--- lib/x86/mmxencfrag.c.orig	Wed Aug 12 22:26:45 2009
+++ lib/x86/mmxencfrag.c	Wed Aug 12 23:43:30 2009
@@ -496,7 +496,10 @@ static unsigned oc_int_frag_satd_thresh_mmxext(const u
     "movq 0x78(%[buf]),%%mm7\n\t"
     /*The sums produced by OC_HADAMARD_ABS_ACCUM_8x4 each have an extra 4
        added to them, and a factor of two removed; correct the final sum here.*/
-    "lea -32(%[ret],%[ret]),%[ret]\n\t"
+    /* Not working "lea -32(%[ret],%[ret]),%[ret]\n\t" */
+    /* Like ret = ret+ret-32 */
+    "add %[ret],%[ret]\n\t"
+    "sub 32,%[ret]\n\t"
     "movq 0x40(%[buf]),%%mm0\n\t"
     "cmp %[ret2],%[ret]\n\t"
     "movq 0x48(%[buf]),%%mm4\n\t"
@@ -511,7 +514,11 @@ static unsigned oc_int_frag_satd_thresh_mmxext(const u
     "punpckhdq %%mm0,%%mm0\n\t"
     "paddd %%mm0,%%mm4\n\t"
     "movd %%mm4,%[ret2]\n\t"
-    "lea (%[ret],%[ret2],2),%[ret]\n\t"
+    /* Not working "lea (%[ret],%[ret2],2),%[ret]\n\t" */
+    /* Like ret = ret2*2 + ret */
+    "mov %[ret2], %%eax\n\t"
+    "add %%eax, %%eax\n\t"
+    "add %%eax, %[ret]\n\t"
     ".p2align 4,,15\n\t"
     "1:\n\t"
     /*Although it looks like we're using 7 registers here, gcc can alias %[ret]
@@ -728,7 +735,13 @@ unsigned oc_enc_frag_intra_satd_mmxext(const unsigned 
     "punpckhdq %%mm0,%%mm0\n\t"
     "paddd %%mm0,%%mm4\n\t"
     "movd %%mm4,%[ret]\n\t"
-    "lea -64(%[ret2],%[ret],2),%[ret]\n\t"
+    /* Not working "lea -64(%[ret2],%[ret],2),%[ret]\n\t" */
+/* Like ret = ret*2 + ret2 -64 */
+    "mov %[ret], %%eax\n\t"
+    "add %%eax, %%eax\n\t"
+    "add %[ret2], %%eax\n\t"
+    "sub %%eax, 64\n\t"
+    "mov %%eax, %[ret]\n\t"
     /*Although it looks like we're using 7 registers here, gcc can alias %[ret]
        and %[ret2] with some of the inputs, since for once we don't write to
        them until after we're done using everything but %[buf] (which is also
@@ -782,7 +795,7 @@ void oc_enc_frag_sub_mmx(ogg_int16_t _residue[64],
       "movq %%mm2,0x08(%[residue])\n\t"
       "movq %%mm4,0x10(%[residue])\n\t"
       "movq %%mm1,0x18(%[residue])\n\t"
-      "lea 0x20(%[residue]),%[residue]\n\t"
+      "lea 0x20(%[residue]),%[residue]\n\t" 
       :[residue]"+r"(_residue),[src]"+r"(_src),[ref]"+r"(_ref)
       :[ystride]"r"((ptrdiff_t)_ystride)
       :"memory"


----- End forwarded message -----

-- 
Dios, gracias por tu amor infinito.
http://www.primarilypublicdomain.org/letter/
--  
  Vladimir Támara Patiño.  
  http://www.geocities.com/v-tamara

-------------- next part --------------
$OpenBSD$
--- lib/x86/mmxencfrag.c.orig	Wed Aug 12 22:26:45 2009
+++ lib/x86/mmxencfrag.c	Wed Aug 12 23:43:30 2009
@@ -496,7 +496,10 @@ static unsigned oc_int_frag_satd_thresh_mmxext(const u
     "movq 0x78(%[buf]),%%mm7\n\t"
     /*The sums produced by OC_HADAMARD_ABS_ACCUM_8x4 each have an extra 4
        added to them, and a factor of two removed; correct the final sum here.*/
-    "lea -32(%[ret],%[ret]),%[ret]\n\t"
+    /* Not working "lea -32(%[ret],%[ret]),%[ret]\n\t" */
+    /* Like ret = ret+ret-32 */
+    "add %[ret],%[ret]\n\t"
+    "sub 32,%[ret]\n\t"
     "movq 0x40(%[buf]),%%mm0\n\t"
     "cmp %[ret2],%[ret]\n\t"
     "movq 0x48(%[buf]),%%mm4\n\t"
@@ -511,7 +514,11 @@ static unsigned oc_int_frag_satd_thresh_mmxext(const u
     "punpckhdq %%mm0,%%mm0\n\t"
     "paddd %%mm0,%%mm4\n\t"
     "movd %%mm4,%[ret2]\n\t"
-    "lea (%[ret],%[ret2],2),%[ret]\n\t"
+    /* Not working "lea (%[ret],%[ret2],2),%[ret]\n\t" */
+    /* Like ret = ret2*2 + ret */
+    "mov %[ret2], %%eax\n\t"
+    "add %%eax, %%eax\n\t"
+    "add %%eax, %[ret]\n\t"
     ".p2align 4,,15\n\t"
     "1:\n\t"
     /*Although it looks like we're using 7 registers here, gcc can alias %[ret]
@@ -728,7 +735,13 @@ unsigned oc_enc_frag_intra_satd_mmxext(const unsigned 
     "punpckhdq %%mm0,%%mm0\n\t"
     "paddd %%mm0,%%mm4\n\t"
     "movd %%mm4,%[ret]\n\t"
-    "lea -64(%[ret2],%[ret],2),%[ret]\n\t"
+    /* Not working "lea -64(%[ret2],%[ret],2),%[ret]\n\t" */
+/* Like ret = ret*2 + ret2 -64 */
+    "mov %[ret], %%eax\n\t"
+    "add %%eax, %%eax\n\t"
+    "add %[ret2], %%eax\n\t"
+    "sub %%eax, 64\n\t"
+    "mov %%eax, %[ret]\n\t"
     /*Although it looks like we're using 7 registers here, gcc can alias %[ret]
        and %[ret2] with some of the inputs, since for once we don't write to
        them until after we're done using everything but %[buf] (which is also
@@ -782,7 +795,7 @@ void oc_enc_frag_sub_mmx(ogg_int16_t _residue[64],
       "movq %%mm2,0x08(%[residue])\n\t"
       "movq %%mm4,0x10(%[residue])\n\t"
       "movq %%mm1,0x18(%[residue])\n\t"
-      "lea 0x20(%[residue]),%[residue]\n\t"
+      "lea 0x20(%[residue]),%[residue]\n\t" 
       :[residue]"+r"(_residue),[src]"+r"(_src),[ref]"+r"(_ref)
       :[ystride]"r"((ptrdiff_t)_ystride)
       :"memory"


More information about the theora mailing list