poor video playback performace with radeon

Taneli Vähäkangas taneli.vahakangas at cs.helsinki.fi
Sun Sep 4 13:44:44 PDT 2011


On Wed, Aug 17, 2011 at 04:40:05PM -0400, Alex Deucher wrote:
> 
> Easiest is to checkout the mesa git tree and build/install mesa from
> there.  Then when you make changes, all you need to do is rebuild and
> install, no restart required.

Ah, now I'm getting somewhere. This is much faster method.

The bitstream decoder was modified quite a lot recently. It fails
for me with the following:
vl_mpg12_bs_decode: Assertion `consumed <= num_bytes' failed.

I made some changes that make it not fail for I and P pictures (B
pictures still fail that assertion). After the changes, the video
displays quite nicely, but there's slow unwanted drifting downwards
(looks like half a pixel every few frames). The patch I used is
at the end of the message, does it make any sense?

Cheers,

	Taneli

diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c b/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
index 936cf2c..35636f0 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
@@ -527,7 +527,7 @@ static struct vl_vlc_entry tbl_B4[1 << 6];
 static struct vl_vlc_entry tbl_B9[1 << 9];
 static struct vl_vlc_entry tbl_B10[1 << 11];
 static struct vl_vlc_entry tbl_B11[1 << 2];
-static struct vl_vlc_entry tbl_B12[1 << 10];
+static struct vl_vlc_entry tbl_B12[1 << 9];
 static struct vl_vlc_entry tbl_B13[1 << 10];
 static struct dct_coeff tbl_B14_DC[1 << 17];
 static struct dct_coeff tbl_B14_AC[1 << 17];
@@ -710,9 +710,6 @@ static INLINE void
 decode_dct(struct vl_mpg12_bs *bs, struct pipe_mpeg12_macroblock *mb, int scale)
 {
    static const unsigned blk2cc[] = { 0, 0, 0, 0, 1, 2 };
-   static const struct vl_vlc_entry *blk2dcsize[] = {
-      tbl_B12, tbl_B12, tbl_B12, tbl_B12, tbl_B13, tbl_B13
-   };
 
    bool intra = mb->macroblock_type & PIPE_MPEG12_MB_TYPE_INTRA;
    const struct dct_coeff *table = intra ? bs->intra_dct_tbl : tbl_B14_AC;
@@ -747,7 +744,12 @@ entry:
 
          if (intra) {
             unsigned cc = blk2cc[blk];
-            unsigned size = vl_vlc_get_vlclbf(&bs->vlc, blk2dcsize[blk], 10);
+            unsigned size;
+            if (cc == 0) {
+               size = vl_vlc_get_vlclbf(&bs->vlc, tbl_B12, 9);
+            } else {
+               size = vl_vlc_get_vlclbf(&bs->vlc, tbl_B13, 10);
+            }
 
             if (size) {
                int dct_diff = vl_vlc_get_uimsbf(&bs->vlc, size);



More information about the xorg mailing list