Change the x86 idct functions to do reconstruction at the same time
Change-Id: I896fe6f9664e6849c7cee2cc6bb4e045eb42540f
This commit is contained in:
Родитель
b2fa74ac18
Коммит
98fcccfe97
|
@ -22,6 +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_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);
|
||||||
|
@ -33,6 +34,9 @@ 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_add
|
||||||
|
#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):
|
||||||
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,6 +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_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;
|
||||||
|
|
||||||
|
|
|
@ -50,12 +50,12 @@ sym(vp8_dequantize_b_impl_mmx):
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
;void dequant_idct_mmx(short *input, short *dq, short *output, int pitch)
|
;void dequant_idct_add_mmx(short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride)
|
||||||
global sym(vp8_dequant_idct_mmx)
|
global sym(vp8_dequant_idct_add_mmx)
|
||||||
sym(vp8_dequant_idct_mmx):
|
sym(vp8_dequant_idct_add_mmx):
|
||||||
push rbp
|
push rbp
|
||||||
mov rbp, rsp
|
mov rbp, rsp
|
||||||
SHADOW_ARGS_TO_STACK 4
|
SHADOW_ARGS_TO_STACK 6
|
||||||
GET_GOT rbx
|
GET_GOT rbx
|
||||||
push rsi
|
push rsi
|
||||||
push rdi
|
push rdi
|
||||||
|
@ -77,7 +77,8 @@ sym(vp8_dequant_idct_mmx):
|
||||||
movq mm3, [rax+24]
|
movq mm3, [rax+24]
|
||||||
pmullw mm3, [rdx+24]
|
pmullw mm3, [rdx+24]
|
||||||
|
|
||||||
mov rdx, arg(2) ;output
|
mov rdx, arg(3) ;dest
|
||||||
|
mov rsi, arg(2) ;pred
|
||||||
pxor mm7, mm7
|
pxor mm7, mm7
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,7 +89,8 @@ sym(vp8_dequant_idct_mmx):
|
||||||
movq [rax+24],mm7
|
movq [rax+24],mm7
|
||||||
|
|
||||||
|
|
||||||
movsxd rax, dword ptr arg(3) ;pitch
|
movsxd rax, dword ptr arg(4) ;pitch
|
||||||
|
movsxd rdi, dword ptr arg(5) ;stride
|
||||||
|
|
||||||
psubw mm0, mm2 ; b1= 0-2
|
psubw mm0, mm2 ; b1= 0-2
|
||||||
paddw mm2, mm2 ;
|
paddw mm2, mm2 ;
|
||||||
|
@ -207,13 +209,34 @@ sym(vp8_dequant_idct_mmx):
|
||||||
punpckldq mm2, mm4 ; 32 22 12 02
|
punpckldq mm2, mm4 ; 32 22 12 02
|
||||||
punpckhdq mm5, mm4 ; 33 23 13 03
|
punpckhdq mm5, mm4 ; 33 23 13 03
|
||||||
|
|
||||||
movq [rdx], mm0
|
pxor mm7, mm7
|
||||||
|
|
||||||
movq [rdx+rax], mm1
|
movd mm4, [rsi]
|
||||||
movq [rdx+rax*2], mm2
|
punpcklbw mm4, mm7
|
||||||
|
paddsw mm0, mm4
|
||||||
|
packuswb mm0, mm7
|
||||||
|
movd [rdx], mm0
|
||||||
|
|
||||||
add rdx, rax
|
movd mm4, [rsi+rax]
|
||||||
movq [rdx+rax*2], mm5
|
punpcklbw mm4, mm7
|
||||||
|
paddsw mm1, mm4
|
||||||
|
packuswb mm1, mm7
|
||||||
|
movd [rdx+rdi], mm1
|
||||||
|
|
||||||
|
movd mm4, [rsi+2*rax]
|
||||||
|
punpcklbw mm4, mm7
|
||||||
|
paddsw mm2, mm4
|
||||||
|
packuswb mm2, mm7
|
||||||
|
movd [rdx+rdi*2], mm2
|
||||||
|
|
||||||
|
add rdx, rdi
|
||||||
|
add rsi, rax
|
||||||
|
|
||||||
|
movd mm4, [rsi+2*rax]
|
||||||
|
punpcklbw mm4, mm7
|
||||||
|
paddsw mm5, mm4
|
||||||
|
packuswb mm5, mm7
|
||||||
|
movd [rdx+rdi*2], mm5
|
||||||
|
|
||||||
; begin epilog
|
; begin epilog
|
||||||
pop rdi
|
pop rdi
|
||||||
|
@ -224,12 +247,12 @@ sym(vp8_dequant_idct_mmx):
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
;void dequant_dc_idct_mmx(short *input, short *dq, short *output, int pitch, int Dc)
|
;void dequant_dc_idct_add_mmx(short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride, int Dc)
|
||||||
global sym(vp8_dequant_dc_idct_mmx)
|
global sym(vp8_dequant_dc_idct_add_mmx)
|
||||||
sym(vp8_dequant_dc_idct_mmx):
|
sym(vp8_dequant_dc_idct_add_mmx):
|
||||||
push rbp
|
push rbp
|
||||||
mov rbp, rsp
|
mov rbp, rsp
|
||||||
SHADOW_ARGS_TO_STACK 5
|
SHADOW_ARGS_TO_STACK 7
|
||||||
GET_GOT rbx
|
GET_GOT rbx
|
||||||
push rsi
|
push rsi
|
||||||
push rdi
|
push rdi
|
||||||
|
@ -238,7 +261,7 @@ sym(vp8_dequant_dc_idct_mmx):
|
||||||
mov rax, arg(0) ;input
|
mov rax, arg(0) ;input
|
||||||
mov rdx, arg(1) ;dq
|
mov rdx, arg(1) ;dq
|
||||||
|
|
||||||
movsxd rcx, dword ptr arg(4) ;Dc
|
movsxd rcx, dword ptr arg(6) ;Dc
|
||||||
|
|
||||||
movq mm0, [rax ]
|
movq mm0, [rax ]
|
||||||
pmullw mm0, [rdx]
|
pmullw mm0, [rdx]
|
||||||
|
@ -252,7 +275,8 @@ sym(vp8_dequant_dc_idct_mmx):
|
||||||
movq mm3, [rax+24]
|
movq mm3, [rax+24]
|
||||||
pmullw mm3, [rdx+24]
|
pmullw mm3, [rdx+24]
|
||||||
|
|
||||||
mov rdx, arg(2) ;output
|
mov rdx, arg(3) ;dest
|
||||||
|
mov rsi, arg(2) ;pred
|
||||||
pxor mm7, mm7
|
pxor mm7, mm7
|
||||||
|
|
||||||
|
|
||||||
|
@ -262,8 +286,10 @@ sym(vp8_dequant_dc_idct_mmx):
|
||||||
movq [rax+16],mm7
|
movq [rax+16],mm7
|
||||||
movq [rax+24],mm7
|
movq [rax+24],mm7
|
||||||
|
|
||||||
|
|
||||||
pinsrw mm0, rcx, 0
|
pinsrw mm0, rcx, 0
|
||||||
movsxd rax, dword ptr arg(3) ;pitch
|
movsxd rax, dword ptr arg(4) ;pitch
|
||||||
|
movsxd rdi, dword ptr arg(5) ;stride
|
||||||
|
|
||||||
psubw mm0, mm2 ; b1= 0-2
|
psubw mm0, mm2 ; b1= 0-2
|
||||||
paddw mm2, mm2 ;
|
paddw mm2, mm2 ;
|
||||||
|
@ -382,13 +408,34 @@ sym(vp8_dequant_dc_idct_mmx):
|
||||||
punpckldq mm2, mm4 ; 32 22 12 02
|
punpckldq mm2, mm4 ; 32 22 12 02
|
||||||
punpckhdq mm5, mm4 ; 33 23 13 03
|
punpckhdq mm5, mm4 ; 33 23 13 03
|
||||||
|
|
||||||
movq [rdx], mm0
|
pxor mm7, mm7
|
||||||
|
|
||||||
movq [rdx+rax], mm1
|
movd mm4, [rsi]
|
||||||
movq [rdx+rax*2], mm2
|
punpcklbw mm4, mm7
|
||||||
|
paddsw mm0, mm4
|
||||||
|
packuswb mm0, mm7
|
||||||
|
movd [rdx], mm0
|
||||||
|
|
||||||
add rdx, rax
|
movd mm4, [rsi+rax]
|
||||||
movq [rdx+rax*2], mm5
|
punpcklbw mm4, mm7
|
||||||
|
paddsw mm1, mm4
|
||||||
|
packuswb mm1, mm7
|
||||||
|
movd [rdx+rdi], mm1
|
||||||
|
|
||||||
|
movd mm4, [rsi+2*rax]
|
||||||
|
punpcklbw mm4, mm7
|
||||||
|
paddsw mm2, mm4
|
||||||
|
packuswb mm2, mm7
|
||||||
|
movd [rdx+rdi*2], mm2
|
||||||
|
|
||||||
|
add rdx, rdi
|
||||||
|
add rsi, rax
|
||||||
|
|
||||||
|
movd mm4, [rsi+2*rax]
|
||||||
|
punpcklbw mm4, mm7
|
||||||
|
paddsw mm5, mm4
|
||||||
|
packuswb mm5, mm7
|
||||||
|
movd [rdx+rdi*2], mm5
|
||||||
|
|
||||||
; begin epilog
|
; begin epilog
|
||||||
pop rdi
|
pop rdi
|
||||||
|
|
|
@ -21,12 +21,20 @@
|
||||||
*/
|
*/
|
||||||
#if HAVE_MMX
|
#if HAVE_MMX
|
||||||
extern prototype_dequant_block(vp8_dequantize_b_mmx);
|
extern prototype_dequant_block(vp8_dequantize_b_mmx);
|
||||||
|
extern prototype_dequant_idct_add(vp8_dequant_idct_add_mmx);
|
||||||
|
extern prototype_dequant_idct_dc_add(vp8_dequant_dc_idct_add_mmx);
|
||||||
|
|
||||||
|
|
||||||
#if !CONFIG_RUNTIME_CPU_DETECT
|
#if !CONFIG_RUNTIME_CPU_DETECT
|
||||||
#undef vp8_dequant_block
|
#undef vp8_dequant_block
|
||||||
#define vp8_dequant_block vp8_dequantize_b_mmx
|
#define vp8_dequant_block vp8_dequantize_b_mmx
|
||||||
|
|
||||||
|
#undef vp8_dequant_idct_add
|
||||||
|
#define vp8_dequant_idct_add vp8_dequant_idct_add_mmx
|
||||||
|
|
||||||
|
#undef vp8_dequant_idct_dc
|
||||||
|
#define vp8_dequant_idct_add_dc vp8_dequant_dc_idct_add_mmx
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,8 @@ void vp8_arch_x86_decode_init(VP8D_COMP *pbi)
|
||||||
if (flags & HAS_MMX)
|
if (flags & HAS_MMX)
|
||||||
{
|
{
|
||||||
pbi->dequant.block = vp8_dequantize_b_mmx;
|
pbi->dequant.block = vp8_dequantize_b_mmx;
|
||||||
|
pbi->dequant.idct_add = vp8_dequant_idct_add_mmx;
|
||||||
|
pbi->dequant.idct_dc_add = vp8_dequant_dc_idct_add_mmx;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче