[Libva] [PATCH] VP8 HWEnc: Fix vp8 mv incorrectly stored issue
Zhong Li
zhong.li at intel.com
Sun May 3 22:09:33 PDT 2015
As vp8 spec, all luma motion vectors are doubled stored.
This patch has much benefit to P frame qualtity.
Signed-off-by: Zhong Li <zhong.li at intel.com>
---
src/gen8_mfc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/gen8_mfc.c b/src/gen8_mfc.c
index 35d6084..0398323 100644
--- a/src/gen8_mfc.c
+++ b/src/gen8_mfc.c
@@ -4202,8 +4202,11 @@ gen8_mfc_vp8_pak_object_inter(VADriverContextP ctx,
/* only support inter_16x16 now */
assert((msg[AVC_INTER_MSG_OFFSET] & INTER_MODE_MASK) == INTER_16X16);
/* for inter_16x16, all 16 MVs should be same,
- * and move mv to the vme mb start address to make sure offset is 64 bytes aligned */
- msg[0] = (msg[AVC_INTER_MV_OFFSET/4] & 0xfffefffe);
+ * and move mv to the vme mb start address to make sure offset is 64 bytes aligned
+ * as vp8 spec, all vp8 luma motion vectors are doulbled stored
+ */
+ msg[0] = (((msg[AVC_INTER_MV_OFFSET/4] & 0xffff0000) << 1) | ((msg[AVC_INTER_MV_OFFSET/4] << 1) & 0xffff));
+
for (i = 1; i < 16; i++) {
msg[i] = msg[0];
}
--
1.9.1
More information about the Libva
mailing list