ref: db389cb804a6e7ba5bd4ed3765d1cb543619ef26
parent: 16a8948c45e8db266984801fb62cd8eca023d7ef
author: Johann <johannkoenig@google.com>
date: Wed Dec 21 07:39:39 EST 2011
Make a local copy of the dequantized data Multithreaded encoding was breaking at low bitrates Please review/comment. Not sure if this is the best fix. Change-Id: I87468c765372593fd865bc82e25121ebb8ca6af2
--- a/vp8/common/invtrans.h
+++ b/vp8/common/invtrans.h
@@ -17,6 +17,10 @@
#include "blockd.h"
#include "onyxc_int.h"
+#if CONFIG_MULTITHREAD
+#include "vpx_mem/vpx_mem.h"
+#endif
+
static void eob_adjust(char *eobs, short *diff)
{
/* eob adjust.... the idct can only skip if both the dc and eob are zero */
@@ -36,6 +40,10 @@
/* save the dc dequant constant in case it is overridden */
short dc_dequant_temp = DQC[0];
+#if CONFIG_MULTITHREAD
+ DECLARE_ALIGNED(16, short, local_dequant[16]);
+#endif
+
if (xd->mode_info_context->mbmi.mode != SPLITMV)
{
/* do 2nd order transform on the dc block */
@@ -51,11 +59,18 @@
}
eob_adjust(xd->eobs, xd->qcoeff);
+#if CONFIG_MULTITHREAD
+ DQC = local_dequant;
+
+ vpx_memcpy(DQC, xd->block[0].dequant,
+ sizeof(local_dequant));
+#endif
+
/* override the dc dequant constant */
DQC[0] = 1;
}
DEQUANT_INVOKE (&rtcd->dequant, idct_add_y_block)
- (xd->qcoeff, xd->block[0].dequant,
+ (xd->qcoeff, DQC,
xd->dst.y_buffer,
xd->dst.y_stride, xd->eobs);