diff options
author | Zhenyu Wang <zhenyu.z.wang@intel.com> | 2008-06-04 22:25:39 +0800 |
---|---|---|
committer | Zhenyu Wang <zhenyu.z.wang@intel.com> | 2008-06-04 22:25:39 +0800 |
commit | 1729a4f29dd52346a9fa997f818d57884047657f (patch) | |
tree | c33f86b0b529b8cd1a2a7856c13e0c2b1837b702 /src | |
parent | 3cc8876db7ba82fa18e8fab4f267ac6e87964c47 (diff) |
xvmc: move block size lookup helper to generic
Diffstat (limited to 'src')
-rw-r--r-- | src/xvmc/i915_xvmc.c | 14 | ||||
-rw-r--r-- | src/xvmc/intel_xvmc.c | 71 | ||||
-rw-r--r-- | src/xvmc/intel_xvmc.h | 2 |
3 files changed, 74 insertions, 13 deletions
diff --git a/src/xvmc/i915_xvmc.c b/src/xvmc/i915_xvmc.c index b1a17b4e..519de5a3 100644 --- a/src/xvmc/i915_xvmc.c +++ b/src/xvmc/i915_xvmc.c @@ -38,18 +38,6 @@ #define VOFFSET(surface) (surface->srf.offset + \ SIZE_Y420(surface->width, surface->height)) -/* Lookup tables to speed common calculations */ -static unsigned int mb_bytes[] = { - 000, 128, 128, 256, 128, 256, 256, 384, // 0 - 128, 256, 256, 384, 256, 384, 384, 512, // 1 - 128, 256, 256, 384, 256, 384, 384, 512, // 10 - 256, 384, 384, 512, 384, 512, 512, 640, // 11 - 128, 256, 256, 384, 256, 384, 384, 512, // 100 - 256, 384, 384, 512, 384, 512, 512, 640, // 101 - 256, 384, 384, 512, 384, 512, 512, 640, // 110 - 384, 512, 512, 640, 512, 640, 640, 768 // 111 -}; - typedef union { short s[4]; uint u[2]; @@ -1931,7 +1919,7 @@ static int i915_xvmc_mc_render_surface(Display *display, XvMCContext *context, XVMC_INFO("no coded blocks present!"); } - bspm = mb_bytes[mb->coded_block_pattern]; + bspm = mb_bytes_420[mb->coded_block_pattern]; if (!bspm) continue; diff --git a/src/xvmc/intel_xvmc.c b/src/xvmc/intel_xvmc.c index 1be8cc6b..f3a83955 100644 --- a/src/xvmc/intel_xvmc.c +++ b/src/xvmc/intel_xvmc.c @@ -26,7 +26,78 @@ */ #include "intel_xvmc.h" +/* global */ struct _intel_xvmc_driver *xvmc_driver = NULL; + +/* Lookup tables to speed common calculations for coded_block_pattern */ +/* each block is ((8*8) * sizeof(short)) */ +unsigned int mb_bytes_420[] = { + 0, /* 0 */ + 128, /* 1 */ + 128, /* 10 */ + 256, /* 11 */ + 128, /* 100 */ + 256, /* 101 */ + 256, /* 110 */ + 384, /* 111 */ + 128, /* 1000 */ + 256, /* 1001 */ + 256, /* 1010 */ + 384, /* 1011 */ + 256, /* 1100 */ + 384, /* 1101 */ + 384, /* 1110 */ + 512, /* 1111 */ + 128, /* 10000 */ + 256, /* 10001 */ + 256, /* 10010 */ + 384, /* 10011 */ + 256, /* 10100 */ + 384, /* 10101 */ + 384, /* 10110 */ + 512, /* 10111 */ + 256, /* 11000 */ + 384, /* 11001 */ + 384, /* 11010 */ + 512, /* 11011 */ + 384, /* 11100 */ + 512, /* 11101 */ + 512, /* 11110 */ + 640, /* 11111 */ + 128, /* 100000 */ + 256, /* 100001 */ + 256, /* 100010 */ + 384, /* 100011 */ + 256, /* 100100 */ + 384, /* 100101 */ + 384, /* 100110 */ + 512, /* 100111 */ + 256, /* 101000 */ + 384, /* 101001 */ + 384, /* 101010 */ + 512, /* 101011 */ + 384, /* 101100 */ + 512, /* 101101 */ + 512, /* 101110 */ + 640, /* 101111 */ + 256, /* 110000 */ + 384, /* 110001 */ + 384, /* 110010 */ + 512, /* 110011 */ + 384, /* 110100 */ + 512, /* 110101 */ + 512, /* 110110 */ + 640, /* 110111 */ + 384, /* 111000 */ + 512, /* 111001 */ + 512, /* 111010 */ + 640, /* 111011 */ + 512, /* 111100 */ + 640, /* 111101 */ + 640, /* 111110 */ + 768 /* 111111 */ +}; + static int error_base; static int event_base; diff --git a/src/xvmc/intel_xvmc.h b/src/xvmc/intel_xvmc.h index bc863c47..e5e623ea 100644 --- a/src/xvmc/intel_xvmc.h +++ b/src/xvmc/intel_xvmc.h @@ -249,4 +249,6 @@ static inline const char* intel_xvmc_decoder_string(int flag) extern intel_xvmc_context_ptr intel_xvmc_find_context(XID id); extern intel_xvmc_surface_ptr intel_xvmc_find_surface(XID id); +extern unsigned int mb_bytes_420[64]; + #endif |