[mythtv] [PATCH] ViaSlice QMatrix

Mike Wood mike at woodsnest.com
Fri Jul 9 09:44:59 EDT 2004


> -------- Original Message --------
> Subject: Re: [mythtv] [PATCH] ViaSlice QMatrix
> From: "Steven Cruysberghs" <steven.cruysberghs at tiscali.be>
> Date: Fri, July 09, 2004 3:51 am
> To: "Development of mythtv" <mythtv-dev at mythtv.org>
> 
> Kenneth Aafl°y schreef:
> 
> >Hi,
> >
> >I've looked at the QMatrix and the possibility of removing the extra viaslice 
> >matrixes in mpeg context, but it looks it will either come to this patch or a 
> >reordering of the default qmatrixes with ff_zigzag_direct, which will touch 
> >to much code.
> >
> >Kenneth
> >  
> >
> >------------------------------------------------------------------------
> >
> >Index: mpeg12.c
> >===================================================================
> >RCS file: /var/lib/mythcvs/mythtv/libs/libavcodec/mpeg12.c,v
> >retrieving revision 1.51
> >diff -u -r1.51 mpeg12.c
> >--- mpeg12.c	21 May 2004 05:30:55 -0000	1.51
> >+++ mpeg12.c	4 Jul 2004 17:33:12 -0000
> >@@ -2104,6 +2104,7 @@
> >         for(i=0;i<64;i++) {
> >             v = get_bits(&s->gb, 8);
> >             j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
> >+            s->viaslice_intra_matrix[i] = v;
> >             s->intra_matrix[j] = v;
> >             s->chroma_intra_matrix[j] = v;
> >         }
> >@@ -2112,6 +2113,7 @@
> >         for(i=0;i<64;i++) {
> >             v = get_bits(&s->gb, 8);
> >             j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
> >+            s->viaslice_inter_matrix[i] = v;
> >             s->inter_matrix[j] = v;
> >             s->chroma_inter_matrix[j] = v;
> >         }
> >@@ -2584,6 +2586,7 @@
> >                 return -1;
> >             }
> >             j = s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
> >+            s->viaslice_intra_matrix[i] = v;
> >             s->intra_matrix[j] = v;
> >             s->chroma_intra_matrix[j] = v;
> >         }
> >@@ -2597,6 +2600,7 @@
> >         for(i=0;i<64;i++) {
> >             j = s->dsp.idct_permutation[i];
> >             v = ff_mpeg1_default_intra_matrix[i];
> >+            s->viaslice_intra_matrix[i] = v;
> >             s->intra_matrix[j] = v;
> >             s->chroma_intra_matrix[j] = v;
> >         }
> >@@ -2609,6 +2613,7 @@
> >                 return -1;
> >             }
> >             j = s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
> >+            s->viaslice_inter_matrix[i] = v;
> >             s->inter_matrix[j] = v;
> >             s->chroma_inter_matrix[j] = v;
> >         }
> >@@ -2622,6 +2627,7 @@
> >         for(i=0;i<64;i++) {
> >             int j= s->dsp.idct_permutation[i];
> >             v = ff_mpeg1_default_non_intra_matrix[i];
> >+            s->viaslice_inter_matrix[i] = v;
> >             s->inter_matrix[j] = v;
> >             s->chroma_inter_matrix[j] = v;
> >         }
> >@@ -2688,10 +2694,12 @@
> >     for(i=0;i<64;i++) {
> >         int j= s->dsp.idct_permutation[i];
> >         v = ff_mpeg1_default_intra_matrix[i];
> >+        s->viaslice_intra_matrix[i] = v;
> >         s->intra_matrix[j] = v;
> >         s->chroma_intra_matrix[j] = v;
> > 
> >         v = ff_mpeg1_default_non_intra_matrix[i];
> >+        s->viaslice_inter_matrix[i] = v;
> >         s->inter_matrix[j] = v;
> >         s->chroma_inter_matrix[j] = v;
> >     }
> >Index: mpegvideo.h
> >===================================================================
> >RCS file: /var/lib/mythcvs/mythtv/libs/libavcodec/mpegvideo.h,v
> >retrieving revision 1.49
> >diff -u -r1.49 mpegvideo.h
> >--- mpegvideo.h	21 May 2004 05:30:55 -0000	1.49
> >+++ mpegvideo.h	4 Jul 2004 17:34:01 -0000
> >@@ -454,6 +454,9 @@
> >     int *mb_index2xy;        ///< mb_index -> mb_x + mb_y*mb_stride
> > 
> >     /** matrix transmitted in the bitstream */
> >+    uint8_t viaslice_intra_matrix[64];
> >+    uint8_t viaslice_inter_matrix[64];
> >+
> >     uint16_t intra_matrix[64];
> >     uint16_t chroma_intra_matrix[64];
> >     uint16_t inter_matrix[64];
> >Index: viaslice.c
> >===================================================================
> >RCS file: /var/lib/mythcvs/mythtv/libs/libavcodec/viaslice.c,v
> >retrieving revision 1.10
> >diff -u -r1.10 viaslice.c
> >--- viaslice.c	25 Jun 2004 21:26:01 -0000	1.10
> >+++ viaslice.c	4 Jul 2004 17:34:08 -0000
> >@@ -23,34 +23,19 @@
> > 
> >     int i,j;
> > 
> >-    for (i=0, j=0; j < 16; i += 4, j += 2)
> >+    for (i=0, j=0; j < 16; i += 4, ++j)
> >     {
> >-        VIAMPGSurface.dwQMatrix[0][j+1] =
> >-          (s->intra_matrix[ s->intra_scantable.permutated[i+0] ] >> 8) << 0 |
> >-          (s->intra_matrix[ s->intra_scantable.permutated[i+1] ] >> 8) << 8 |
> >-          (s->intra_matrix[ s->intra_scantable.permutated[i+2] ] >> 8) << 16 |
> >-          (s->intra_matrix[ s->intra_scantable.permutated[i+3] ] >> 8) << 24;
> >-
> >-        VIAMPGSurface.dwQMatrix[0][j+0] =
> >-          (s->intra_matrix[ s->intra_scantable.permutated[i+0] ] & 0xff) << 0 |
> >-          (s->intra_matrix[ s->intra_scantable.permutated[i+1] ] & 0xff) << 8 |
> >-          (s->intra_matrix[ s->intra_scantable.permutated[i+2] ] & 0xff) << 16 |
> >-          (s->intra_matrix[ s->intra_scantable.permutated[i+3] ] & 0xff) << 24;
> >-    }
> >-
> >-    for (i = 0, j = 0; j < 16; i += 4, j += 2)
> >-    {
> >-        VIAMPGSurface.dwQMatrix[1][j+1] =
> >-          (s->inter_matrix[ s->inter_scantable.permutated[i+0] ] >> 8) << 0 |
> >-          (s->inter_matrix[ s->inter_scantable.permutated[i+1] ] >> 8) << 8 |
> >-          (s->inter_matrix[ s->inter_scantable.permutated[i+2] ] >> 8) << 16 |
> >-          (s->inter_matrix[ s->inter_scantable.permutated[i+3] ] >> 8) << 24;
> >-
> >-        VIAMPGSurface.dwQMatrix[1][j+0] =
> >-          (s->inter_matrix[ s->inter_scantable.permutated[i+0] ] & 0xff) << 0 |
> >-          (s->inter_matrix[ s->inter_scantable.permutated[i+1] ] & 0xff) << 8 |
> >-          (s->inter_matrix[ s->inter_scantable.permutated[i+2] ] & 0xff) << 16 |
> >-          (s->inter_matrix[ s->inter_scantable.permutated[i+3] ] & 0xff) << 24;
> >+        VIAMPGSurface.dwQMatrix[0][j] =
> >+            s->viaslice_intra_matrix[i] |
> >+            s->viaslice_intra_matrix[i+1] << 8 |
> >+            s->viaslice_intra_matrix[i+2] << 16 |
> >+            s->viaslice_intra_matrix[i+3] << 24;
> >+
> >+        VIAMPGSurface.dwQMatrix[1][j] =
> >+            s->viaslice_inter_matrix[i] |
> >+            s->viaslice_inter_matrix[i+1] << 8 |
> >+            s->viaslice_inter_matrix[i+2] << 16 |
> >+            s->viaslice_inter_matrix[i+3] << 24;
> >     }
> > 
> >     VIAMPGSurface.dwQMatrixChanged = 1;
> >  
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >mythtv-dev mailing list
> >mythtv-dev at mythtv.org
> >http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> >  
> >
> Kenneth,
> 
> Just be sure before I start messing with kernel en xfree modules... (again)
> The combination mythcvs,  this patch, the viaslice-field-reverse.patch 
> for videoout_viaslice.cpp andyour new version of  libddmpeg (1.7) works 
> for you?
> 
> Thanks for all the effort ..
> 
> Steven
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


Steven,

This is my interpretation as well, however, I can't get the
viaslice-field-reverse.patch to work.  It craps out on me, and I'm no
coder, so I have no idea why.  The other patch worked fine.  I'm
running Gentoo with:

Kernel:   2.4.25-epia2-r2 
xfree:     4.4.0
libddmpeg:  1.7

When I try to play something in myth, the log tells me I have "software
flip" but I get an immediate lockup.

Mike










More information about the mythtv-dev mailing list