diff options
author | Zhao, Halley <halley.zhao@intel.com> | 2014-01-10 09:53:16 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-01-15 13:38:02 +0800 |
commit | 137d446cc546d4529d3293df235ae862ac93bf68 (patch) | |
tree | ea6637e802b54b98fff245d8d3d219e23b2ca543 | |
parent | 2ff0ce3696ce5a90eef01539beaf6d7b9af29d3b (diff) | |
download | libva-intel-driver-137d446cc546d4529d3293df235ae862ac93bf68.tar.gz libva-intel-driver-137d446cc546d4529d3293df235ae862ac93bf68.tar.bz2 libva-intel-driver-137d446cc546d4529d3293df235ae862ac93bf68.zip |
vp8 dec: fix when bool_coder_ctx.count is 0
bool_coder_ctx.count is remaining bits,
hw requires used-bits-count: 8-bool_coder_ctx.count, range [0,7]
update offset and partition_size[0] as well
Signed-off-by: Zhao Halley <halley.zhao@intel.com>
-rw-r--r-- | src/gen8_mfd.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gen8_mfd.c b/src/gen8_mfd.c index abf3078..b828675 100644 --- a/src/gen8_mfd.c +++ b/src/gen8_mfd.c @@ -2965,6 +2965,15 @@ gen8_mfd_vp8_bsd_object(VADriverContextP ctx, struct intel_batchbuffer *batch = gen7_mfd_context->base.batch; int i, log2num; unsigned int offset = slice_param->slice_data_offset + ((slice_param->macroblock_offset + 7 ) >> 3); + unsigned int used_bits = 8-pic_param->bool_coder_ctx.count; + unsigned int partition_size_0 = slice_param->partition_size[0]; + + assert(pic_param->bool_coder_ctx.count >= 0 && pic_param->bool_coder_ctx.count <= 7); + if (used_bits == 8) { + used_bits = 0; + offset += 1; + partition_size_0 -= 1; + } assert(slice_param->num_of_partitions >= 2); assert(slice_param->num_of_partitions <= 9); @@ -2974,8 +2983,7 @@ gen8_mfd_vp8_bsd_object(VADriverContextP ctx, BEGIN_BCS_BATCH(batch, 22); OUT_BCS_BATCH(batch, MFD_VP8_BSD_OBJECT | (22 - 2)); OUT_BCS_BATCH(batch, - // XXX, when bool_coder_ctx.count (remaining bits in value) is 0, 0 is also expected for CPBAC Entropy Count? - ((8-pic_param->bool_coder_ctx.count)%8) << 16 | /* Partition 0 CPBAC Entropy Count */ + used_bits << 16 | /* Partition 0 CPBAC Entropy Count */ pic_param->bool_coder_ctx.range << 8 | /* Partition 0 Count Entropy Range */ log2num << 4 | (slice_param->macroblock_offset & 0x7)); @@ -2983,7 +2991,10 @@ gen8_mfd_vp8_bsd_object(VADriverContextP ctx, pic_param->bool_coder_ctx.value << 24 | /* Partition 0 Count Entropy Value */ 0); - for (i = 0; i < 9; i++) { + OUT_BCS_BATCH(batch, partition_size_0); + OUT_BCS_BATCH(batch, offset); + offset += partition_size_0; + for (i = 1; i < 9; i++) { if (i < slice_param->num_of_partitions) { OUT_BCS_BATCH(batch, slice_param->partition_size[i]); OUT_BCS_BATCH(batch, offset); |