Hey,

today I tried to compile schro with opengl and got a couple of errors.
The attached patch fixes most of them but there is still an open issue
with the testsuite, maybe someone with deeper knowledge can have a look
at it.
I also do not know if the internals of the opengl part are still up to
date.

- fabian
>From fe705bb43bce14247cd1381817aaebea573897d1 Mon Sep 17 00:00:00 2001
From: Fabian Deutsch <fabian.deut...@gmx.de>
Date: Wed, 9 Feb 2011 19:27:38 +0100
Subject: [PATCH] Fix opengl compile errors.

Signed-off-by: Fabian Deutsch <fabian.deut...@gmx.de>
---
 schroedinger/opengl/Makefile.am                |    2 +-
 schroedinger/opengl/schroopengl.c              |    3 ++-
 schroedinger/opengl/schroopenglframe_combine.c |    2 +-
 schroedinger/opengl/schroopenglframe_convert.c |    2 +-
 schroedinger/opengl/schroopenglframe_pull.c    |    6 +++---
 schroedinger/opengl/schroopenglframe_push.c    |    6 +++---
 schroedinger/opengl/schroopenglmotion.c        |   16 ++++++++--------
 schroedinger/schrodecoder.c                    |    2 +-
 schroedinger/schromotion.h                     |    1 -
 testsuite/opengl/opengl.c                      |   17 ++++++++---------
 10 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/schroedinger/opengl/Makefile.am b/schroedinger/opengl/Makefile.am
index cd8d312..4abb708 100644
--- a/schroedinger/opengl/Makefile.am
+++ b/schroedinger/opengl/Makefile.am
@@ -17,7 +17,7 @@ libopengl_la_SOURCES = \
 	schroopengltypes.h \
 	schroopenglwavelet.c
 
-libopengl_la_CFLAGS = $(SCHRO_CFLAGS) $(OPENGL_CFLAGS) $(ERROR_CFLAGS) \
+libopengl_la_CFLAGS = $(SCHRO_CFLAGS) $(ORC_CFLAGS) $(OPENGL_CFLAGS) $(ERROR_CFLAGS) \
 	-DSCHRO_ENABLE_UNSTABLE_API -D_GNU_SOURCE -DSCHRO_OPENGL_UNBIND_TEXTURES=1
 
 libopengl_la_LIBADD = $(OPENGL_LIBS)
diff --git a/schroedinger/opengl/schroopengl.c b/schroedinger/opengl/schroopengl.c
index f204b88..59e7ce2 100644
--- a/schroedinger/opengl/schroopengl.c
+++ b/schroedinger/opengl/schroopengl.c
@@ -3,6 +3,7 @@
 #include "config.h"
 #endif
 #include <schroedinger/schro.h>
+#include <schroedinger/schroasync.h>
 #include <schroedinger/opengl/schroopengl.h>
 #include <schroedinger/opengl/schroopenglcanvas.h>
 #include <schroedinger/opengl/schroopenglshader.h>
@@ -268,7 +269,7 @@ schro_opengl_new (void)
   opengl->canvas_pool = NULL;
   opengl->obmc_weight_canvas = NULL;
 
-  opengl->mutex = schro_mutex_new_recursive ();
+  opengl->mutex = schro_mutex_new ();
 
   if (!schro_opengl_open_display (opengl, NULL)) {
     opengl->is_usable = FALSE;
diff --git a/schroedinger/opengl/schroopenglframe_combine.c b/schroedinger/opengl/schroopenglframe_combine.c
index 284047a..2565f2e 100644
--- a/schroedinger/opengl/schroopenglframe_combine.c
+++ b/schroedinger/opengl/schroopenglframe_combine.c
@@ -7,7 +7,7 @@
 #include <schroedinger/opengl/schroopenglcanvas.h>
 #include <schroedinger/opengl/schroopenglframe.h>
 #include <schroedinger/opengl/schroopenglshader.h>
-#include <liboil/liboil.h>
+/*#include <liboil/liboil.h>*/
 
 typedef void (*SchroOpenGLFrameBinaryFunc) (SchroFrame *dest, SchroFrame *src);
 
diff --git a/schroedinger/opengl/schroopenglframe_convert.c b/schroedinger/opengl/schroopenglframe_convert.c
index eb3c3cc..531ec06 100644
--- a/schroedinger/opengl/schroopenglframe_convert.c
+++ b/schroedinger/opengl/schroopenglframe_convert.c
@@ -7,7 +7,7 @@
 #include <schroedinger/opengl/schroopenglcanvas.h>
 #include <schroedinger/opengl/schroopenglframe.h>
 #include <schroedinger/opengl/schroopenglshader.h>
-#include <liboil/liboil.h>
+/*#include <liboil/liboil.h>*/
 
 #define CONVERT_PROTOTYPE(_func) \
     static void schro_opengl_frame_convert_##_func (SchroFrame *dest, \
diff --git a/schroedinger/opengl/schroopenglframe_pull.c b/schroedinger/opengl/schroopenglframe_pull.c
index 6c580f0..3b04ee7 100644
--- a/schroedinger/opengl/schroopenglframe_pull.c
+++ b/schroedinger/opengl/schroopenglframe_pull.c
@@ -6,7 +6,7 @@
 #include <schroedinger/opengl/schroopengl.h>
 #include <schroedinger/opengl/schroopenglcanvas.h>
 #include <schroedinger/opengl/schroopenglframe.h>
-#include <liboil/liboil.h>
+#include <orc/orc.h>
 
 static void
 schro_opengl_canvas_pull_convert (SchroFrameData *dest, SchroOpenGLCanvas *src,
@@ -65,7 +65,7 @@ schro_opengl_canvas_pull_convert (SchroFrameData *dest, SchroOpenGLCanvas *src,
           }
         } else {
           for (y = 0; y < height; ++y) {
-            oil_memcpy (frame_data_u8, texture_data_u8, width);
+            orc_memcpy (frame_data_u8, texture_data_u8, width);
 
             frame_data_u8 = OFFSET (frame_data_u8, frame_stride);
             texture_data_u8 = OFFSET (texture_data_u8, texture_stride);
@@ -121,7 +121,7 @@ schro_opengl_canvas_pull_convert (SchroFrameData *dest, SchroOpenGLCanvas *src,
           }
         } else {
           for (y = 0; y < height; ++y) {
-            oil_memcpy (frame_data_s16, texture_data_s16,
+            orc_memcpy (frame_data_s16, texture_data_s16,
                 width * sizeof (int16_t));
 
             frame_data_s16 = OFFSET (frame_data_s16, frame_stride);
diff --git a/schroedinger/opengl/schroopenglframe_push.c b/schroedinger/opengl/schroopenglframe_push.c
index ee9733d..61d78b5 100644
--- a/schroedinger/opengl/schroopenglframe_push.c
+++ b/schroedinger/opengl/schroopenglframe_push.c
@@ -7,7 +7,7 @@
 #include <schroedinger/opengl/schroopenglcanvas.h>
 #include <schroedinger/opengl/schroopenglframe.h>
 #include <schroedinger/opengl/schroopenglshader.h>
-#include <liboil/liboil.h>
+#include <orc/orc.h>
 
 static void
 schro_opengl_canvas_push_convert (SchroOpenGLCanvas *dest, SchroFrameData *src,
@@ -66,7 +66,7 @@ schro_opengl_canvas_push_convert (SchroOpenGLCanvas *dest, SchroFrameData *src,
           }
         } else {
           for (y = 0; y < height; ++y) {
-            oil_memcpy (texture_data_u8, frame_data_u8, width);
+            orc_memcpy (texture_data_u8, frame_data_u8, width);
 
             texture_data_u8 = OFFSET (texture_data_u8, texture_stride);
             frame_data_u8 = OFFSET (frame_data_u8, frame_stride);
@@ -116,7 +116,7 @@ schro_opengl_canvas_push_convert (SchroOpenGLCanvas *dest, SchroFrameData *src,
           }
         } else {
           for (y = 0; y < height; ++y) {
-            oil_memcpy (texture_data_s16, frame_data_s16,
+            orc_memcpy (texture_data_s16, frame_data_s16,
                 width * sizeof (int16_t));
 
             texture_data_s16 = OFFSET (texture_data_s16, texture_stride);
diff --git a/schroedinger/opengl/schroopenglmotion.c b/schroedinger/opengl/schroopenglmotion.c
index 38472a7..e9faef8 100644
--- a/schroedinger/opengl/schroopenglmotion.c
+++ b/schroedinger/opengl/schroopenglmotion.c
@@ -27,13 +27,13 @@ schro_opengl_motion_render_dc_block (SchroOpenGLMotion *opengl_motion, int i,
 {
   int xblen, yblen;
   SchroMotion *motion;
-  SchroMotionVectorDC *motion_vector_dc;
+  SchroMotionVector *motion_vector_dc;
   uint8_t dc;
 
   motion = opengl_motion->motion;
-  motion_vector_dc = (SchroMotionVectorDC *)
+  motion_vector_dc = (SchroMotionVector *)
       &motion->motion_vectors[v * motion->params->x_num_blocks + u];
-  dc = (int) motion_vector_dc->dc[i] + 128;
+  dc = (int) motion_vector_dc->u.dc.dc[i] + 128;
 
   glUseProgramObjectARB (opengl_motion->shader_dc->program);
 
@@ -75,8 +75,8 @@ schro_opengl_motion_render_ref_block (SchroOpenGLMotion *opengl_motion,
 
   SCHRO_ASSERT (motion_vector->using_global == FALSE);
 
-  dx = motion_vector->dx[ref];
-  dy = motion_vector->dy[ref];
+  dx = motion_vector->u.vec.dx[ref];
+  dy = motion_vector->u.vec.dy[ref];
 
   if (i > 0) {
     dx >>= SCHRO_CHROMA_FORMAT_H_SHIFT (chroma_format);
@@ -170,15 +170,15 @@ schro_opengl_motion_render_ref_block (SchroOpenGLMotion *opengl_motion,
 
       switch (fd->width) {
         case 8:
-          oil_avg2_8xn_u8 (fd->data, fd->stride,
+          orc_avg2_8xn_u8 (fd->data, fd->stride,
               fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height);
           break;
         case 12:
-          oil_avg2_12xn_u8 (fd->data, fd->stride,
+          orc_avg2_12xn_u8 (fd->data, fd->stride,
               fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height);
           break;
         case 16:
-          oil_avg2_16xn_u8 (fd->data, fd->stride,
+          orc_avg2_16xn_u8 (fd->data, fd->stride,
               fd00.data, fd00.stride, fd10.data, fd10.stride, fd->height);
           break;
         default:
diff --git a/schroedinger/schrodecoder.c b/schroedinger/schrodecoder.c
index 1c1e779..6097d15 100644
--- a/schroedinger/schrodecoder.c
+++ b/schroedinger/schrodecoder.c
@@ -1715,7 +1715,7 @@ schro_decoder_x_render_motion (SchroAsyncStage * stage)
       picture->ref_output_frame =
           schro_opengl_frame_new (decoder->opengl, decoder->opengl_domain,
           frame_format, picture->decoder_instance->video_format.width,
-          schro_video_format_get_picture_height (&decoder->video_format));
+          schro_video_format_get_picture_height (&picture->decoder_instance->video_format));
 #else
       SCHRO_ASSERT (0);
 #endif
diff --git a/schroedinger/schromotion.h b/schroedinger/schromotion.h
index ed4d2ac..91479ee 100644
--- a/schroedinger/schromotion.h
+++ b/schroedinger/schromotion.h
@@ -11,7 +11,6 @@
 SCHRO_BEGIN_DECLS
 
 typedef struct _SchroMotionVector SchroMotionVector;
-typedef struct _SchroMotionVectorDC SchroMotionVectorDC;
 typedef struct _SchroMotionField SchroMotionField;
 typedef struct _SchroMotion SchroMotion;
 typedef struct _SchroMotionScan SchroMotionScan;
diff --git a/testsuite/opengl/opengl.c b/testsuite/opengl/opengl.c
index 801ca5b..9210c2a 100644
--- a/testsuite/opengl/opengl.c
+++ b/testsuite/opengl/opengl.c
@@ -430,7 +430,7 @@ opengl_test_motion (int width, int height,
   SchroFrame *opengl_dest_frame;
   SchroUpsampledFrame *upsampled_cpu_frame;
   SchroUpsampledFrame *upsampled_opengl_frame;
-  SchroMotionVectorDC *motion_vectors_dc;
+  SchroMotionVector *motion_vectors_dc;
   SchroMotion motion_cpu;
   SchroMotion motion_opengl;
   char pattern_name[TEST_PATTERN_NAME_SIZE];
@@ -487,7 +487,7 @@ opengl_test_motion (int width, int height,
     schro_opengl_upsampled_frame_upsample (upsampled_opengl_frame);
 
 
-    motion_vectors_dc = schro_malloc0 (sizeof (SchroMotionVectorDC) *
+    motion_vectors_dc = schro_malloc0 (sizeof (SchroMotionVector) *
         params.x_num_blocks * params.y_num_blocks);
 
     for (v = 0; v < params.y_num_blocks; ++v) {
@@ -495,15 +495,15 @@ opengl_test_motion (int width, int height,
         if (u == 1 && (v == 1/* || v == 2*/)) {
           motion_vectors_dc[v * params.x_num_blocks + u].pred_mode = 0;
           motion_vectors_dc[v * params.x_num_blocks + u].using_global = FALSE;
-          motion_vectors_dc[v * params.x_num_blocks + u].dc[0] = 64;
-          motion_vectors_dc[v * params.x_num_blocks + u].dc[1] = 0;
-          motion_vectors_dc[v * params.x_num_blocks + u].dc[2] = 0;
+          motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[0] = 64;
+          motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[1] = 0;
+          motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[2] = 0;
         } else {
           motion_vectors_dc[v * params.x_num_blocks + u].pred_mode = 0;
           motion_vectors_dc[v * params.x_num_blocks + u].using_global = FALSE;
-          motion_vectors_dc[v * params.x_num_blocks + u].dc[0] = 0;
-          motion_vectors_dc[v * params.x_num_blocks + u].dc[1] = 0;
-          motion_vectors_dc[v * params.x_num_blocks + u].dc[2] = 0;
+          motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[0] = 0;
+          motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[1] = 0;
+          motion_vectors_dc[v * params.x_num_blocks + u].u.dc.dc[2] = 0;
         }
       }
     }
@@ -524,7 +524,6 @@ opengl_test_motion (int width, int height,
     motion_opengl.mv_precision = 0;
 
 
-
     schro_motion_render (&motion_cpu, cpu_dest_ref_frame);
     schro_opengl_motion_render (&motion_opengl, opengl_dest_frame);
 
-- 
1.7.4

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Schrodinger-devel mailing list
Schrodinger-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/schrodinger-devel

Reply via email to