[xiph-commits] r11519 - branches/theora-playtime/lib

illiminable at svn.xiph.org illiminable at svn.xiph.org
Sun Jun 4 11:57:28 PDT 2006


Author: illiminable
Date: 2006-06-04 11:57:20 -0700 (Sun, 04 Jun 2006)
New Revision: 11519

Modified:
   branches/theora-playtime/lib/dct_decode.c
   branches/theora-playtime/lib/dsp.c
   branches/theora-playtime/lib/dsp.h
Log:
* Factor FilterVert and FilterHoriz out of dct_decode.c
* Add setup for FilterVert and FilterHoriz functions

Modified: branches/theora-playtime/lib/dct_decode.c
===================================================================
--- branches/theora-playtime/lib/dct_decode.c	2006-06-04 18:30:35 UTC (rev 11518)
+++ branches/theora-playtime/lib/dct_decode.c	2006-06-04 18:57:20 UTC (rev 11519)
@@ -19,6 +19,7 @@
 #include <string.h>
 #include "codec_internal.h"
 #include "dsp.h"
+#include "cpu.h"
 
 
 #define GOLDEN_FRAME_THRESH_Q   50
@@ -680,7 +681,7 @@
   }
 }
 
-static void FilterHoriz(unsigned char * PixelPtr,
+static void FilterHoriz__c(unsigned char * PixelPtr,
                         ogg_int32_t LineLength,
                         ogg_int32_t *BoundingValuePtr){
   ogg_int32_t j;
@@ -702,7 +703,7 @@
   }
 }
 
-static void FilterVert(unsigned char * PixelPtr,
+static void FilterVert__c(unsigned char * PixelPtr,
                 ogg_int32_t LineLength,
                 ogg_int32_t *BoundingValuePtr){
   ogg_int32_t j;
@@ -797,14 +798,14 @@
       /* Filter right hand border only if the block to the right is
          not coded */
       if ( !pbi->display_fragments[ i + 1 ] ){
-        FilterHoriz(pbi->LastFrameRecon+
+        dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                     pbi->recon_pixel_index_table[i]+6,
                     LineLength,BoundingValuePtr);
       }
 
       /* Bottom done if next row set */
       if( !pbi->display_fragments[ i + LineFragments] ){
-        FilterVert(pbi->LastFrameRecon+
+        dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                    pbi->recon_pixel_index_table[i+LineFragments],
                    LineLength, BoundingValuePtr);
       }
@@ -816,21 +817,21 @@
     for ( n = 1 ; n < FragsAcross - 1 ; n++, i++) {
       if( pbi->display_fragments[i]){
         /* Filter Left edge always */
-        FilterHoriz(pbi->LastFrameRecon+
+        dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                     pbi->recon_pixel_index_table[i]-2,
                     LineLength, BoundingValuePtr);
 
         /* Filter right hand border only if the block to the right is
            not coded */
         if ( !pbi->display_fragments[ i + 1 ] ){
-          FilterHoriz(pbi->LastFrameRecon+
+          dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                       pbi->recon_pixel_index_table[i]+6,
                       LineLength, BoundingValuePtr);
         }
 
         /* Bottom done if next row set */
         if( !pbi->display_fragments[ i + LineFragments] ){
-          FilterVert(pbi->LastFrameRecon+
+          dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                      pbi->recon_pixel_index_table[i + LineFragments],
                      LineLength, BoundingValuePtr);
         }
@@ -842,13 +843,13 @@
     /* Last Column */
     if( pbi->display_fragments[i]){
       /* Filter Left edge always */
-      FilterHoriz(pbi->LastFrameRecon+
+      dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                   pbi->recon_pixel_index_table[i] - 2 ,
                   LineLength, BoundingValuePtr);
 
       /* Bottom done if next row set */
       if( !pbi->display_fragments[ i + LineFragments] ){
-        FilterVert(pbi->LastFrameRecon+
+        dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                    pbi->recon_pixel_index_table[i + LineFragments],
                    LineLength, BoundingValuePtr);
       }
@@ -866,21 +867,21 @@
          all fragments are intra */
       if( pbi->display_fragments[i]){
         /* TopRow is always done */
-        FilterVert(pbi->LastFrameRecon+
+        dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                    pbi->recon_pixel_index_table[i],
                    LineLength, BoundingValuePtr);
 
         /* Filter right hand border only if the block to the right is
            not coded */
         if ( !pbi->display_fragments[ i + 1 ] ){
-          FilterHoriz(pbi->LastFrameRecon+
+          dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                       pbi->recon_pixel_index_table[i] + 6,
                       LineLength, BoundingValuePtr);
         }
 
         /* Bottom done if next row set */
         if( !pbi->display_fragments[ i + LineFragments] ){
-          FilterVert(pbi->LastFrameRecon+
+          dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                      pbi->recon_pixel_index_table[i + LineFragments],
                      LineLength, BoundingValuePtr);
         }
@@ -892,26 +893,26 @@
       for ( n = 1 ; n < FragsAcross - 1 ; n++, i++){
         if( pbi->display_fragments[i]){
           /* Filter Left edge always */
-          FilterHoriz(pbi->LastFrameRecon+
+          dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                       pbi->recon_pixel_index_table[i] - 2,
                       LineLength, BoundingValuePtr);
 
           /* TopRow is always done */
-          FilterVert(pbi->LastFrameRecon+
+          dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                      pbi->recon_pixel_index_table[i],
                      LineLength, BoundingValuePtr);
 
           /* Filter right hand border only if the block to the right
              is not coded */
           if ( !pbi->display_fragments[ i + 1 ] ){
-            FilterHoriz(pbi->LastFrameRecon+
+            dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                         pbi->recon_pixel_index_table[i] + 6,
                         LineLength, BoundingValuePtr);
           }
 
           /* Bottom done if next row set */
           if( !pbi->display_fragments[ i + LineFragments] ){
-            FilterVert(pbi->LastFrameRecon+
+            dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                        pbi->recon_pixel_index_table[i + LineFragments],
                        LineLength, BoundingValuePtr);
           }
@@ -922,18 +923,18 @@
       /* Last Column */
       if( pbi->display_fragments[i]){
         /* Filter Left edge always*/
-        FilterHoriz(pbi->LastFrameRecon+
+        dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                     pbi->recon_pixel_index_table[i] - 2,
                     LineLength, BoundingValuePtr);
 
         /* TopRow is always done */
-        FilterVert(pbi->LastFrameRecon+
+        dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                    pbi->recon_pixel_index_table[i],
                    LineLength, BoundingValuePtr);
 
         /* Bottom done if next row set */
         if( !pbi->display_fragments[ i + LineFragments] ){
-          FilterVert(pbi->LastFrameRecon+
+          dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                      pbi->recon_pixel_index_table[i + LineFragments],
                      LineLength, BoundingValuePtr);
         }
@@ -951,14 +952,14 @@
     if( pbi->display_fragments[i]){
 
       /* TopRow is always done */
-      FilterVert(pbi->LastFrameRecon+
+      dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                  pbi->recon_pixel_index_table[i],
                  LineLength, BoundingValuePtr);
 
       /* Filter right hand border only if the block to the right is
          not coded */
       if ( !pbi->display_fragments[ i + 1 ] ){
-        FilterHoriz(pbi->LastFrameRecon+
+        dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                     pbi->recon_pixel_index_table[i] + 6,
                     LineLength, BoundingValuePtr);
       }
@@ -970,19 +971,19 @@
     for ( n = 1 ; n < FragsAcross - 1 ; n++, i++){
       if( pbi->display_fragments[i]){
         /* Filter Left edge always */
-        FilterHoriz(pbi->LastFrameRecon+
+        dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                     pbi->recon_pixel_index_table[i] - 2,
                     LineLength, BoundingValuePtr);
 
         /* TopRow is always done */
-        FilterVert(pbi->LastFrameRecon+
+        dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                    pbi->recon_pixel_index_table[i],
                    LineLength, BoundingValuePtr);
 
         /* Filter right hand border only if the block to the right is
            not coded */
         if ( !pbi->display_fragments[ i + 1 ] ){
-          FilterHoriz(pbi->LastFrameRecon+
+          dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                       pbi->recon_pixel_index_table[i] + 6,
                       LineLength, BoundingValuePtr);
         }
@@ -993,12 +994,12 @@
     /* Last Column */
     if( pbi->display_fragments[i]){
       /* Filter Left edge always */
-      FilterHoriz(pbi->LastFrameRecon+
+      dsp_dct_decode_filter_horiz(pbi->dsp, pbi->LastFrameRecon+
                   pbi->recon_pixel_index_table[i] - 2,
                   LineLength, BoundingValuePtr);
 
       /* TopRow is always done */
-      FilterVert(pbi->LastFrameRecon+
+      dsp_dct_decode_filter_vert(pbi->dsp, pbi->LastFrameRecon+
                  pbi->recon_pixel_index_table[i],
                  LineLength, BoundingValuePtr);
 
@@ -1229,3 +1230,21 @@
     UpdateUMVBorder(pbi, pbi->GoldenFrame);
   }
 }
+
+
+void dsp_dct_decode_init (DspFunctions *funcs, ogg_uint32_t cpu_flags)
+{
+
+    funcs->FilterHoriz = FilterHoriz__c;
+    funcs->FilterVert = FilterVert__c;
+
+#if defined(USE_ASM)
+  //if (cpu_flags & CPU_X86_MMX) {
+  //  dsp_mmx_idct_init(funcs);
+  //}
+
+  //if (cpu_flags & CPU_X86_SSE2) {
+  //  dsp_sse2_dct_decode_init(funcs);
+  //}
+#endif
+}

Modified: branches/theora-playtime/lib/dsp.c
===================================================================
--- branches/theora-playtime/lib/dsp.c	2006-06-04 18:30:35 UTC (rev 11518)
+++ branches/theora-playtime/lib/dsp.c	2006-06-04 18:57:20 UTC (rev 11519)
@@ -410,6 +410,7 @@
   dsp_recon_init (funcs, cpuflags);
   dsp_dct_init (funcs, cpuflags);
   dsp_idct_init (funcs, cpuflags);
+  dsp_dct_decode_init(funcs, cpuflags);
 #if defined(USE_ASM)
   if (cpuflags & CPU_X86_MMX) {
     dsp_mmx_init(funcs);

Modified: branches/theora-playtime/lib/dsp.h
===================================================================
--- branches/theora-playtime/lib/dsp.h	2006-06-04 18:30:35 UTC (rev 11518)
+++ branches/theora-playtime/lib/dsp.h	2006-06-04 18:57:20 UTC (rev 11519)
@@ -102,15 +102,26 @@
                    ogg_int16_t * quantized_list,
                    ogg_int32_t * DCT_block);
 
+  /* dct_decode */
+  void (*FilterHoriz)(unsigned char * PixelPtr,
+                        ogg_int32_t LineLength,
+                        ogg_int32_t *BoundingValuePtr);
 
+  void (*FilterVert)(unsigned char * PixelPtr,
+                ogg_int32_t LineLength,
+                ogg_int32_t *BoundingValuePtr);
 
 
+
+
 } DspFunctions;
 
 extern void dsp_dct_init(DspFunctions *funcs, ogg_uint32_t cpu_flags);
 extern void dsp_recon_init (DspFunctions *funcs, ogg_uint32_t cpu_flags);
 extern void dsp_idct_init (DspFunctions *funcs, ogg_uint32_t cpu_flags);
+extern void dsp_dct_decode_init (DspFunctions *funcs, ogg_uint32_t cpu_flags);
 
+
 void dsp_init(DspFunctions *funcs);
 void dsp_static_init(DspFunctions *funcs);
 #if defined(USE_ASM) && (defined(__i386__) || defined(__x86_64__) || defined(WIN32))
@@ -181,6 +192,13 @@
 #define dsp_idct_dequant_slow(funcs, ptr1, ptr2, ptr3) \
             (funcs.dequant_slow (ptr1, ptr2, ptr3))
 
+#define dsp_dct_decode_filter_horiz(funcs, ptr1, a1, ptr2) \
+            (funcs.FilterHoriz (ptr1, a1, ptr2))
 
+#define dsp_dct_decode_filter_vert(funcs, ptr1, a1, ptr2) \
+            (funcs.FilterVert (ptr1, a1, ptr2))
 
+
+
+
 #endif /* DSP_H */



More information about the commits mailing list