Mesa (pipe-video): [g3dvl] move dummy quantification into xvmc state tracker

Christian König deathsimple at kemper.freedesktop.org
Tue Jun 7 22:35:53 UTC 2011


Module: Mesa
Branch: pipe-video
Commit: f1bf7d3dbfa8c74b9537e6132f17dd8250a3451b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f1bf7d3dbfa8c74b9537e6132f17dd8250a3451b

Author: Christian König <deathsimple at vodafone.de>
Date:   Tue Jun  7 21:13:59 2011 +0200

[g3dvl] move dummy quantification into xvmc state tracker

---

 src/gallium/auxiliary/vl/vl_mpeg12_decoder.c   |   18 +++---------------
 src/gallium/include/pipe/p_video_context.h     |    4 ++--
 src/gallium/state_trackers/xorg/xvmc/surface.c |   13 +++++++++++++
 3 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index 238785f..eacb49e 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -312,28 +312,16 @@ vl_mpeg12_buffer_begin_frame(struct pipe_video_decode_buffer *buffer)
 
       vl_mpg12_bs_set_buffers(&buf->bs, ycbcr_stream, buf->texels, mv_stream);
    } else {
-      static const uint8_t dummy_quant[64] = {
-         0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
-         0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
-         0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
-         0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
-         0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
-         0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
-         0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
-         0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10
-      };
 
-      for (i = 0; i < VL_MAX_PLANES; ++i) {
+      for (i = 0; i < VL_MAX_PLANES; ++i)
          vl_zscan_set_layout(&buf->zscan[i], dec->zscan_linear);
-         vl_zscan_upload_quant(&buf->zscan[i], dummy_quant, dummy_quant);
-      }
    }
 }
 
 static void
 vl_mpeg12_buffer_set_quant_matrix(struct pipe_video_decode_buffer *buffer,
-                                  uint8_t intra_matrix[64],
-                                  uint8_t non_intra_matrix[64])
+                                  const uint8_t intra_matrix[64],
+                                  const uint8_t non_intra_matrix[64])
 {
    struct vl_mpeg12_buffer *buf = (struct vl_mpeg12_buffer*)buffer;
    unsigned i;
diff --git a/src/gallium/include/pipe/p_video_context.h b/src/gallium/include/pipe/p_video_context.h
index bea5067..2a30099 100644
--- a/src/gallium/include/pipe/p_video_context.h
+++ b/src/gallium/include/pipe/p_video_context.h
@@ -183,8 +183,8 @@ struct pipe_video_decode_buffer
     * set the quantification matrixes
     */
    void (*set_quant_matrix)(struct pipe_video_decode_buffer *decbuf,
-                            uint8_t intra_matrix[64],
-                            uint8_t non_intra_matrix[64]);
+                            const uint8_t intra_matrix[64],
+                            const uint8_t non_intra_matrix[64]);
 
    /**
     * get the pointer where to put the ycbcr blocks of a component
diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c
index 4d6c58e..3db17d1 100644
--- a/src/gallium/state_trackers/xorg/xvmc/surface.c
+++ b/src/gallium/state_trackers/xorg/xvmc/surface.c
@@ -291,6 +291,17 @@ unmap_and_flush_surface(XvMCSurfacePrivate *surface)
 PUBLIC
 Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surface)
 {
+   static const uint8_t dummy_quant[64] = {
+      0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+      0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+      0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+      0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+      0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+      0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+      0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+      0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10
+   };
+
    XvMCContextPrivate *context_priv;
    struct pipe_video_context *vpipe;
    XvMCSurfacePrivate *surface_priv;
@@ -312,6 +323,8 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac
       return BadAlloc;
 
    surface_priv->decode_buffer = context_priv->decoder->create_buffer(context_priv->decoder);
+   surface_priv->decode_buffer->set_quant_matrix(surface_priv->decode_buffer, dummy_quant, dummy_quant);
+
    surface_priv->mv_stride = surface_priv->decode_buffer->get_mv_stream_stride(surface_priv->decode_buffer);
    surface_priv->video_buffer = vpipe->create_buffer(vpipe, PIPE_FORMAT_NV12,
                                                      context_priv->decoder->chroma_format,




More information about the mesa-commit mailing list