Commit 3de8a958 authored by Fritz Koenig's avatar Fritz Koenig Committed by Code Review

Merge changes I896fe6f9,I90d8b167

* changes:
  Change the x86 idct functions to do reconstruction at the same time
  Combine idct and reconstruction steps
parents 2add72d9 98fcccfe
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#if HAVE_ARMV6 #if HAVE_ARMV6
extern prototype_idct(vp8_short_idct4x4llm_1_v6); extern prototype_idct(vp8_short_idct4x4llm_1_v6);
extern prototype_idct(vp8_short_idct4x4llm_v6_dual); extern prototype_idct(vp8_short_idct4x4llm_v6_dual);
extern prototype_idct_scalar(vp8_dc_only_idct_armv6);
extern prototype_second_order(vp8_short_inv_walsh4x4_1_armv6); extern prototype_second_order(vp8_short_inv_walsh4x4_1_armv6);
extern prototype_second_order(vp8_short_inv_walsh4x4_armv6); extern prototype_second_order(vp8_short_inv_walsh4x4_armv6);
...@@ -25,9 +24,6 @@ extern prototype_second_order(vp8_short_inv_walsh4x4_armv6); ...@@ -25,9 +24,6 @@ extern prototype_second_order(vp8_short_inv_walsh4x4_armv6);
#undef vp8_idct_idct16 #undef vp8_idct_idct16
#define vp8_idct_idct16 vp8_short_idct4x4llm_v6_dual #define vp8_idct_idct16 vp8_short_idct4x4llm_v6_dual
#undef vp8_idct_idct1_scalar
#define vp8_idct_idct1_scalar vp8_dc_only_idct_armv6
#undef vp8_idct_iwalsh1 #undef vp8_idct_iwalsh1
#define vp8_idct_iwalsh1 vp8_short_inv_walsh4x4_1_armv6 #define vp8_idct_iwalsh1 vp8_short_inv_walsh4x4_1_armv6
...@@ -38,7 +34,6 @@ extern prototype_second_order(vp8_short_inv_walsh4x4_armv6); ...@@ -38,7 +34,6 @@ extern prototype_second_order(vp8_short_inv_walsh4x4_armv6);
#if HAVE_ARMV7 #if HAVE_ARMV7
extern prototype_idct(vp8_short_idct4x4llm_1_neon); extern prototype_idct(vp8_short_idct4x4llm_1_neon);
extern prototype_idct(vp8_short_idct4x4llm_neon); extern prototype_idct(vp8_short_idct4x4llm_neon);
extern prototype_idct_scalar(vp8_dc_only_idct_neon);
extern prototype_second_order(vp8_short_inv_walsh4x4_1_neon); extern prototype_second_order(vp8_short_inv_walsh4x4_1_neon);
extern prototype_second_order(vp8_short_inv_walsh4x4_neon); extern prototype_second_order(vp8_short_inv_walsh4x4_neon);
...@@ -48,9 +43,6 @@ extern prototype_second_order(vp8_short_inv_walsh4x4_neon); ...@@ -48,9 +43,6 @@ extern prototype_second_order(vp8_short_inv_walsh4x4_neon);
#undef vp8_idct_idct16 #undef vp8_idct_idct16
#define vp8_idct_idct16 vp8_short_idct4x4llm_neon #define vp8_idct_idct16 vp8_short_idct4x4llm_neon
#undef vp8_idct_idct1_scalar
#define vp8_idct_idct1_scalar vp8_dc_only_idct_neon
#undef vp8_idct_iwalsh1 #undef vp8_idct_iwalsh1
#define vp8_idct_iwalsh1 vp8_short_inv_walsh4x4_1_neon #define vp8_idct_iwalsh1 vp8_short_inv_walsh4x4_1_neon
......
...@@ -43,7 +43,6 @@ void vp8_machine_specific_config(VP8_COMMON *ctx) ...@@ -43,7 +43,6 @@ void vp8_machine_specific_config(VP8_COMMON *ctx)
rtcd->idct.idct1 = vp8_short_idct4x4llm_1_neon; rtcd->idct.idct1 = vp8_short_idct4x4llm_1_neon;
rtcd->idct.idct16 = vp8_short_idct4x4llm_neon; rtcd->idct.idct16 = vp8_short_idct4x4llm_neon;
rtcd->idct.idct1_scalar = vp8_dc_only_idct_neon;
rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_neon; rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_neon;
rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_neon; rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_neon;
...@@ -75,7 +74,6 @@ void vp8_machine_specific_config(VP8_COMMON *ctx) ...@@ -75,7 +74,6 @@ void vp8_machine_specific_config(VP8_COMMON *ctx)
rtcd->idct.idct1 = vp8_short_idct4x4llm_1_v6; rtcd->idct.idct1 = vp8_short_idct4x4llm_1_v6;
rtcd->idct.idct16 = vp8_short_idct4x4llm_v6_dual; rtcd->idct.idct16 = vp8_short_idct4x4llm_v6_dual;
rtcd->idct.idct1_scalar = vp8_dc_only_idct_armv6;
rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_armv6; rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_armv6;
rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_armv6; rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_armv6;
......
...@@ -32,7 +32,7 @@ void vp8_machine_specific_config(VP8_COMMON *ctx) ...@@ -32,7 +32,7 @@ void vp8_machine_specific_config(VP8_COMMON *ctx)
rtcd->idct.idct1 = vp8_short_idct4x4llm_1_c; rtcd->idct.idct1 = vp8_short_idct4x4llm_1_c;
rtcd->idct.idct16 = vp8_short_idct4x4llm_c; rtcd->idct.idct16 = vp8_short_idct4x4llm_c;
rtcd->idct.idct1_scalar = vp8_dc_only_idct_c; rtcd->idct.idct1_scalar_add = vp8_dc_only_idct_add_c;
rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_c; rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_c;
rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_c; rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_c;
......
...@@ -18,8 +18,10 @@ ...@@ -18,8 +18,10 @@
#define prototype_idct(sym) \ #define prototype_idct(sym) \
void sym(short *input, short *output, int pitch) void sym(short *input, short *output, int pitch)
#define prototype_idct_scalar(sym) \ #define prototype_idct_scalar_add(sym) \
void sym(short input, short *output, int pitch) void sym(short input, \
unsigned char *pred, unsigned char *output, \
int pitch, int stride)
#if ARCH_X86 || ARCH_X86_64 #if ARCH_X86 || ARCH_X86_64
#include "x86/idct_x86.h" #include "x86/idct_x86.h"
...@@ -39,10 +41,10 @@ extern prototype_idct(vp8_idct_idct1); ...@@ -39,10 +41,10 @@ extern prototype_idct(vp8_idct_idct1);
#endif #endif
extern prototype_idct(vp8_idct_idct16); extern prototype_idct(vp8_idct_idct16);
#ifndef vp8_idct_idct1_scalar #ifndef vp8_idct_idct1_scalar_add
#define vp8_idct_idct1_scalar vp8_dc_only_idct_c #define vp8_idct_idct1_scalar_add vp8_dc_only_idct_add_c
#endif #endif
extern prototype_idct_scalar(vp8_idct_idct1_scalar); extern prototype_idct_scalar_add(vp8_idct_idct1_scalar_add);
#ifndef vp8_idct_iwalsh1 #ifndef vp8_idct_iwalsh1
...@@ -56,14 +58,14 @@ extern prototype_second_order(vp8_idct_iwalsh1); ...@@ -56,14 +58,14 @@ extern prototype_second_order(vp8_idct_iwalsh1);
extern prototype_second_order(vp8_idct_iwalsh16); extern prototype_second_order(vp8_idct_iwalsh16);
typedef prototype_idct((*vp8_idct_fn_t)); typedef prototype_idct((*vp8_idct_fn_t));
typedef prototype_idct_scalar((*vp8_idct_scalar_fn_t)); typedef prototype_idct_scalar_add((*vp8_idct_scalar_add_fn_t));
typedef prototype_second_order((*vp8_second_order_fn_t)); typedef prototype_second_order((*vp8_second_order_fn_t));
typedef struct typedef struct
{ {
vp8_idct_fn_t idct1; vp8_idct_fn_t idct1;
vp8_idct_fn_t idct16; vp8_idct_fn_t idct16;
vp8_idct_scalar_fn_t idct1_scalar; vp8_idct_scalar_add_fn_t idct1_scalar_add;
vp8_second_order_fn_t iwalsh1; vp8_second_order_fn_t iwalsh1;
vp8_second_order_fn_t iwalsh16; vp8_second_order_fn_t iwalsh16;
......
...@@ -104,23 +104,30 @@ void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch) ...@@ -104,23 +104,30 @@ void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch)
} }
} }
void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, int pitch, int stride)
void vp8_dc_only_idct_c(short input_dc, short *output, int pitch)
{ {
int i; int a1 = ((input_dc + 4) >> 3);
int a1; int r, c;
short *op = output;
int shortpitch = pitch >> 1;
a1 = ((input_dc + 4) >> 3);
for (i = 0; i < 4; i++) for (r = 0; r < 4; r++)
{ {
op[0] = a1; for (c = 0; c < 4; c++)
op[1] = a1; {
op[2] = a1; int a = a1 + pred_ptr[c] ;
op[3] = a1;
op += shortpitch; if (a < 0)
a = 0;
if (a > 255)
a = 255;
dst_ptr[c] = (unsigned char) a ;
}
dst_ptr += stride;
pred_ptr += pitch;
} }
} }
void vp8_short_inv_walsh4x4_c(short *input, short *output) void vp8_short_inv_walsh4x4_c(short *input, short *output)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#if HAVE_MMX #if HAVE_MMX
extern prototype_idct(vp8_short_idct4x4llm_1_mmx); extern prototype_idct(vp8_short_idct4x4llm_1_mmx);
extern prototype_idct(vp8_short_idct4x4llm_mmx); extern prototype_idct(vp8_short_idct4x4llm_mmx);
extern prototype_idct_scalar(vp8_dc_only_idct_mmx); extern prototype_idct_scalar_add(vp8_dc_only_idct_add_mmx);
extern prototype_second_order(vp8_short_inv_walsh4x4_mmx); extern prototype_second_order(vp8_short_inv_walsh4x4_mmx);
extern prototype_second_order(vp8_short_inv_walsh4x4_1_mmx); extern prototype_second_order(vp8_short_inv_walsh4x4_1_mmx);
...@@ -34,8 +34,8 @@ extern prototype_second_order(vp8_short_inv_walsh4x4_1_mmx); ...@@ -34,8 +34,8 @@ extern prototype_second_order(vp8_short_inv_walsh4x4_1_mmx);
#undef vp8_idct_idct16 #undef vp8_idct_idct16
#define vp8_idct_idct16 vp8_short_idct4x4llm_mmx #define vp8_idct_idct16 vp8_short_idct4x4llm_mmx
#undef vp8_idct_idct1_scalar #undef vp8_idct_idct1_scalar_add
#define vp8_idct_idct1_scalar vp8_dc_only_idct_mmx #define vp8_idct_idct1_scalar_add vp8_dc_only_idct_add_mmx
#undef vp8_idct_iwalsh16 #undef vp8_idct_iwalsh16
#define vp8_idct_iwalsh16 vp8_short_inv_walsh4x4_mmx #define vp8_idct_iwalsh16 vp8_short_inv_walsh4x4_mmx
......
...@@ -220,35 +220,61 @@ sym(vp8_short_idct4x4llm_1_mmx): ...@@ -220,35 +220,61 @@ sym(vp8_short_idct4x4llm_1_mmx):
pop rbp pop rbp
ret ret
;void dc_only_idct_mmx(short input_dc, short *output, int pitch) ;void vp8_dc_only_idct_add_mmx(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, int pitch, int stride)
global sym(vp8_dc_only_idct_mmx) global sym(vp8_dc_only_idct_add_mmx)
sym(vp8_dc_only_idct_mmx): sym(vp8_dc_only_idct_add_mmx):
push rbp push rbp
mov rbp, rsp mov rbp, rsp
SHADOW_ARGS_TO_STACK 3 SHADOW_ARGS_TO_STACK 5
GET_GOT rbx GET_GOT rbx
push rsi
push rdi
; end prolog ; end prolog
movd mm0, arg(0) ;input_dc mov rsi, arg(1) ;s -- prediction
mov rdi, arg(2) ;d -- destination
movsxd rax, dword ptr arg(4) ;stride
movsxd rdx, dword ptr arg(3) ;pitch
pxor mm0, mm0
paddw mm0, [fours GLOBAL] movd mm5, arg(0) ;input_dc
mov rdx, arg(1) ;output
psraw mm0, 3 paddw mm5, [fours GLOBAL]
movsxd rax, dword ptr arg(2) ;pitch
punpcklwd mm0, mm0 psraw mm5, 3
punpckldq mm0, mm0
movq [rdx], mm0 punpcklwd mm5, mm5
movq [rdx+rax], mm0 punpckldq mm5, mm5
movq [rdx+rax*2], mm0 movd mm1, [rsi]
add rdx, rax punpcklbw mm1, mm0
paddsw mm1, mm5
packuswb mm1, mm0 ; pack and unpack to saturate
movd [rdi], mm1
movq [rdx+rax*2], mm0 movd mm2, [rsi+rdx]
punpcklbw mm2, mm0
paddsw mm2, mm5
packuswb mm2, mm0 ; pack and unpack to saturate
movd [rdi+rax], mm2
movd mm3, [rsi+2*rdx]
punpcklbw mm3, mm0
paddsw mm3, mm5
packuswb mm3, mm0 ; pack and unpack to saturate
movd [rdi+2*rax], mm3
add rdi, rax
add rsi, rdx
movd mm4, [rsi+2*rdx]
punpcklbw mm4, mm0
paddsw mm4, mm5
packuswb mm4, mm0 ; pack and unpack to saturate
movd [rdi+2*rax], mm4
; begin epilog ; begin epilog
pop rdi
pop rsi
RESTORE_GOT RESTORE_GOT
UNSHADOW_ARGS UNSHADOW_ARGS
pop rbp pop rbp
......
...@@ -42,7 +42,7 @@ void vp8_arch_x86_common_init(VP8_COMMON *ctx) ...@@ -42,7 +42,7 @@ void vp8_arch_x86_common_init(VP8_COMMON *ctx)
{ {
rtcd->idct.idct1 = vp8_short_idct4x4llm_1_mmx; rtcd->idct.idct1 = vp8_short_idct4x4llm_1_mmx;
rtcd->idct.idct16 = vp8_short_idct4x4llm_mmx; rtcd->idct.idct16 = vp8_short_idct4x4llm_mmx;
rtcd->idct.idct1_scalar = vp8_dc_only_idct_mmx; rtcd->idct.idct1_scalar_add = vp8_dc_only_idct_add_mmx;
rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_mmx; rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_mmx;
rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_mmx; rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_mmx;
......
...@@ -14,32 +14,14 @@ ...@@ -14,32 +14,14 @@
#if HAVE_ARMV6 #if HAVE_ARMV6
extern prototype_dequant_block(vp8_dequantize_b_v6); extern prototype_dequant_block(vp8_dequantize_b_v6);
extern prototype_dequant_idct(vp8_dequant_idct_v6);
extern prototype_dequant_idct_dc(vp8_dequant_dc_idct_v6);
#undef vp8_dequant_block #undef vp8_dequant_block
#define vp8_dequant_block vp8_dequantize_b_v6 #define vp8_dequant_block vp8_dequantize_b_v6
#undef vp8_dequant_idct
#define vp8_dequant_idct vp8_dequant_idct_v6
#undef vp8_dequant_idct_dc
#define vp8_dequant_idct_dc vp8_dequant_dc_idct_v6
#endif
#if HAVE_ARMV7 #if HAVE_ARMV7
extern prototype_dequant_block(vp8_dequantize_b_neon); extern prototype_dequant_block(vp8_dequantize_b_neon);
extern prototype_dequant_idct(vp8_dequant_idct_neon);
extern prototype_dequant_idct_dc(vp8_dequant_dc_idct_neon);
#undef vp8_dequant_block #undef vp8_dequant_block
#define vp8_dequant_block vp8_dequantize_b_neon #define vp8_dequant_block vp8_dequantize_b_neon
#undef vp8_dequant_idct
#define vp8_dequant_idct vp8_dequant_idct_neon
#undef vp8_dequant_idct_dc
#define vp8_dequant_idct_dc vp8_dequant_dc_idct_neon
#endif
#endif #endif
...@@ -23,8 +23,6 @@ void vp8_dmachine_specific_config(VP8D_COMP *pbi) ...@@ -23,8 +23,6 @@ void vp8_dmachine_specific_config(VP8D_COMP *pbi)
pbi->mb.rtcd = &pbi->common.rtcd; pbi->mb.rtcd = &pbi->common.rtcd;
#if HAVE_ARMV7 #if HAVE_ARMV7
pbi->dequant.block = vp8_dequantize_b_neon; pbi->dequant.block = vp8_dequantize_b_neon;
pbi->dequant.idct = vp8_dequant_idct_neon;
pbi->dequant.idct_dc = vp8_dequant_dc_idct_neon;
pbi->dboolhuff.start = vp8dx_start_decode_c; pbi->dboolhuff.start = vp8dx_start_decode_c;
pbi->dboolhuff.fill = vp8dx_bool_decoder_fill_c; pbi->dboolhuff.fill = vp8dx_bool_decoder_fill_c;
pbi->dboolhuff.debool = vp8dx_decode_bool_c; pbi->dboolhuff.debool = vp8dx_decode_bool_c;
...@@ -32,8 +30,6 @@ void vp8_dmachine_specific_config(VP8D_COMP *pbi) ...@@ -32,8 +30,6 @@ void vp8_dmachine_specific_config(VP8D_COMP *pbi)
#elif HAVE_ARMV6 #elif HAVE_ARMV6
pbi->dequant.block = vp8_dequantize_b_v6; pbi->dequant.block = vp8_dequantize_b_v6;
pbi->dequant.idct = vp8_dequant_idct_v6;
pbi->dequant.idct_dc = vp8_dequant_dc_idct_v6;
pbi->dboolhuff.start = vp8dx_start_decode_c; pbi->dboolhuff.start = vp8dx_start_decode_c;
pbi->dboolhuff.fill = vp8dx_bool_decoder_fill_c; pbi->dboolhuff.fill = vp8dx_bool_decoder_fill_c;
pbi->dboolhuff.debool = vp8dx_decode_bool_c; pbi->dboolhuff.debool = vp8dx_decode_bool_c;
......
...@@ -126,7 +126,6 @@ static void skip_recon_mb(VP8D_COMP *pbi, MACROBLOCKD *xd) ...@@ -126,7 +126,6 @@ static void skip_recon_mb(VP8D_COMP *pbi, MACROBLOCKD *xd)
} }
} }
static void clamp_mv_to_umv_border(MV *mv, const MACROBLOCKD *xd) static void clamp_mv_to_umv_border(MV *mv, const MACROBLOCKD *xd)
{ {
/* If the MV points so far into the UMV border that no visible pixels /* If the MV points so far into the UMV border that no visible pixels
...@@ -182,8 +181,48 @@ static void clamp_mvs(MACROBLOCKD *xd) ...@@ -182,8 +181,48 @@ static void clamp_mvs(MACROBLOCKD *xd)
} }
static void reconstruct_mb(VP8D_COMP *pbi, MACROBLOCKD *xd) void vp8_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd)
{ {
int eobtotal = 0;
MV orig_mvs[24];
int i, do_clamp = xd->mbmi.need_to_clamp_mvs;
if (xd->mbmi.mb_skip_coeff)
{
vp8_reset_mb_tokens_context(xd);
}
else
{
eobtotal = vp8_decode_mb_tokens(pbi, xd);
}
/* Perform temporary clamping of the MV to be used for prediction */
if (do_clamp)
{
if (xd->mbmi.mode == SPLITMV)
for (i=0; i<24; i++)
orig_mvs[i] = xd->block[i].bmi.mv.as_mv;
else
{
orig_mvs[0] = xd->mbmi.mv.as_mv;
orig_mvs[1] = xd->block[16].bmi.mv.as_mv;
}
clamp_mvs(xd);
}
xd->mode_info_context->mbmi.dc_diff = 1;
if (xd->mbmi.mode != B_PRED && xd->mbmi.mode != SPLITMV && eobtotal == 0)
{
xd->mode_info_context->mbmi.dc_diff = 0;
skip_recon_mb(pbi, xd);
return;
}
if (xd->segmentation_enabled)
mb_init_dequantizer(pbi, xd);
// do prediction
if (xd->frame_type == KEY_FRAME || xd->mbmi.ref_frame == INTRA_FRAME) if (xd->frame_type == KEY_FRAME || xd->mbmi.ref_frame == INTRA_FRAME)
{ {
vp8_build_intra_predictors_mbuv(xd); vp8_build_intra_predictors_mbuv(xd);
...@@ -191,29 +230,19 @@ static void reconstruct_mb(VP8D_COMP *pbi, MACROBLOCKD *xd) ...@@ -191,29 +230,19 @@ static void reconstruct_mb(VP8D_COMP *pbi, MACROBLOCKD *xd)
if (xd->mbmi.mode != B_PRED) if (xd->mbmi.mode != B_PRED)
{ {
vp8_build_intra_predictors_mby_ptr(xd); vp8_build_intra_predictors_mby_ptr(xd);
vp8_recon16x16mb(RTCD_VTABLE(recon), xd); } else {
} vp8_intra_prediction_down_copy(xd);
else
{
vp8_recon_intra4x4mb(RTCD_VTABLE(recon), xd);
} }
} }
else else
{ {
vp8_build_inter_predictors_mb(xd); vp8_build_inter_predictors_mb(xd);
vp8_recon16x16mb(RTCD_VTABLE(recon), xd);
} }
}
static void de_quantand_idct(VP8D_COMP *pbi, MACROBLOCKD *xd)
{
int i;
BLOCKD *b = &xd->block[24];
// dequantization and idct
if (xd->mbmi.mode != B_PRED && xd->mbmi.mode != SPLITMV) if (xd->mbmi.mode != B_PRED && xd->mbmi.mode != SPLITMV)
{ {
BLOCKD *b = &xd->block[24];
DEQUANT_INVOKE(&pbi->dequant, block)(b); DEQUANT_INVOKE(&pbi->dequant, block)(b);
// do 2nd order transform on the dc block // do 2nd order transform on the dc block
...@@ -243,105 +272,66 @@ static void de_quantand_idct(VP8D_COMP *pbi, MACROBLOCKD *xd) ...@@ -243,105 +272,66 @@ static void de_quantand_idct(VP8D_COMP *pbi, MACROBLOCKD *xd)
if (b->eob > 1) if (b->eob > 1)
{ {
DEQUANT_INVOKE(&pbi->dequant, idct_dc)(b->qcoeff, &b->dequant[0][0], b->diff, 32, xd->block[24].diff[i]); DEQUANT_INVOKE(&pbi->dequant, idct_dc_add)(b->qcoeff, &b->dequant[0][0], b->predictor, *(b->base_dst) + b->dst, 16, b->dst_stride,
xd->block[24].diff[i]);
} }
else else
{ {
IDCT_INVOKE(RTCD_VTABLE(idct), idct1_scalar)(xd->block[24].diff[i], b->diff, 32); IDCT_INVOKE(RTCD_VTABLE(idct), idct1_scalar_add)(xd->block[24].diff[i], b->predictor, *(b->base_dst) + b->dst, 16, b->dst_stride);
} }
} }
}
for (i = 16; i < 24; i++) else if ((xd->frame_type == KEY_FRAME || xd->mbmi.ref_frame == INTRA_FRAME) && xd->mbmi.mode == B_PRED)
{
for (i = 0; i < 16; i++)
{ {
b = &xd->block[i];
BLOCKD *b = &xd->block[i];
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
if (b->eob > 1) if (b->eob > 1)
{ {
DEQUANT_INVOKE(&pbi->dequant, idct)(b->qcoeff, &b->dequant[0][0], b->diff, 16); DEQUANT_INVOKE(&pbi->dequant, idct_add)(b->qcoeff, &b->dequant[0][0], b->predictor, *(b->base_dst) + b->dst, 16, b->dst_stride);
} }
else else
{ {
IDCT_INVOKE(RTCD_VTABLE(idct), idct1_scalar)(b->qcoeff[0] * b->dequant[0][0], b->diff, 16); IDCT_INVOKE(RTCD_VTABLE(idct), idct1_scalar_add)(b->qcoeff[0] * b->dequant[0][0], b->predictor, *(b->base_dst) + b->dst, 16, b->dst_stride);
((int *)b->qcoeff)[0] = 0; ((int *)b->qcoeff)[0] = 0;
} }
} }
} }
else else
{ {
for (i = 0; i < 24; i++) for (i = 0; i < 16; i++)
{ {
BLOCKD *b = &xd->block[i];
b = &xd->block[i];
if (b->eob > 1) if (b->eob > 1)
{ {
DEQUANT_INVOKE(&pbi->dequant, idct)(b->qcoeff, &b->dequant[0][0], b->diff, (32 - (i & 16))); DEQUANT_INVOKE(&pbi->dequant, idct_add)(b->qcoeff, &b->dequant[0][0], b->predictor, *(b->base_dst) + b->dst, 16, b->dst_stride);
} }
else else
{ {
IDCT_INVOKE(RTCD_VTABLE(idct), idct1_scalar)(b->qcoeff[0] * b->dequant[0][0], b->diff, (32 - (i & 16))); IDCT_INVOKE(RTCD_VTABLE(idct), idct1_scalar_add)(b->qcoeff[0] * b->dequant[0][0], b->predictor, *(b->base_dst) + b->dst, 16, b->dst_stride);
((int *)b->qcoeff)[0] = 0; ((int *)b->qcoeff)[0] = 0;
} }
} }
} }
}
void vp8_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd) for (i = 16; i < 24; i++)
{
int eobtotal = 0;
MV orig_mvs[24];
int i, do_clamp = xd->mbmi.need_to_clamp_mvs;
if (xd->mbmi.mb_skip_coeff)
{
vp8_reset_mb_tokens_context(xd);