1 |
;/************************************************************************** |
;/**************************************************************************** |
2 |
; * |
; * |
3 |
; * XVID MPEG-4 VIDEO CODEC |
; * XVID MPEG-4 VIDEO CODEC |
4 |
; * mmx cbp calc |
; * - 3dne CBP computation - |
5 |
; * |
; * |
6 |
; * This program is an implementation of a part of one or more MPEG-4 |
; * Copyright (C) 2002 Jaan Kalda |
|
; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
|
|
; * to use this software module in hardware or software products are |
|
|
; * advised that its use may infringe existing patents or copyrights, and |
|
|
; * any such use would be at such party's own risk. The original |
|
|
; * developer of this software module and his/her company, and subsequent |
|
|
; * editors and their companies, will have no liability for use of this |
|
|
; * software or modifications or derivatives thereof. |
|
7 |
; * |
; * |
8 |
; * This program is free software; you can redistribute it and/or modify |
; * This program is free software; you can redistribute it and/or modify |
9 |
; * it under the terms of the GNU General Public License as published by |
; * it under the terms of the GNU General Public License as published by |
17 |
; * |
; * |
18 |
; * You should have received a copy of the GNU General Public License |
; * You should have received a copy of the GNU General Public License |
19 |
; * along with this program; if not, write to the Free Software |
; * along with this program; if not, write to the Free Software |
20 |
; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
; * |
; * |
22 |
; *************************************************************************/ |
; * $Id: cbp_3dne.asm,v 1.3 2004-03-22 22:36:23 edgomez Exp $ |
23 |
|
; * |
24 |
|
; ***************************************************************************/ |
25 |
|
|
26 |
|
; these 3dne functions are compatible with iSSE, but are optimized |
27 |
|
; specifically for K7 pipelines |
28 |
|
|
29 |
; these 3dne functions are compatible with iSSE, but are optimized specifically for |
BITS 32 |
|
; K7 pipelines |
|
|
; |
|
|
;------------------------------------------------------------------------------ |
|
|
; 09.12.2002 Athlon optimizations contributed by Jaan Kalda |
|
|
;------------------------------------------------------------------------------ |
|
30 |
|
|
31 |
bits 32 |
;============================================================================= |
32 |
|
; Macros |
33 |
|
;============================================================================= |
34 |
|
|
|
section .data |
|
35 |
%macro cglobal 1 |
%macro cglobal 1 |
36 |
%ifdef PREFIX |
%ifdef PREFIX |
37 |
global _%1 |
global _%1 |
41 |
%endif |
%endif |
42 |
%endmacro |
%endmacro |
43 |
|
|
|
section .text |
|
|
|
|
|
cglobal calc_cbp_3dne |
|
44 |
|
|
|
;=========================================================================== |
|
|
; |
|
|
; uint32_t calc_cbp_3dne(const int16_t coeff[6][64]); |
|
|
; |
|
|
;=========================================================================== |
|
45 |
%macro calc_cbp 1 |
%macro calc_cbp 1 |
46 |
pshufw mm0, [eax], 229 ; =11100101 |
pshufw mm0, [eax], 229 ; =11100101 |
47 |
movq mm1, [eax+8] |
movq mm1, [eax+8] |
76 |
movd [esp+%1*4],mm7 |
movd [esp+%1*4],mm7 |
77 |
%endmacro |
%endmacro |
78 |
|
|
79 |
|
;============================================================================= |
80 |
|
; Code |
81 |
|
;============================================================================= |
82 |
|
|
83 |
|
SECTION .text |
84 |
|
|
85 |
|
cglobal calc_cbp_3dne |
86 |
|
|
87 |
|
;----------------------------------------------------------------------------- |
88 |
|
; uint32_t calc_cbp_3dne(const int16_t coeff[6*64]); |
89 |
|
;----------------------------------------------------------------------------- |
90 |
|
;AMD K7, in cache: ca 80 clk |
91 |
|
|
92 |
align 16 ;AMD K7, in cache: ca 80 clk |
ALIGN 16 |
93 |
calc_cbp_3dne: |
calc_cbp_3dne: |
94 |
mov eax, [esp+ 4] ; coeff |
mov eax, [esp+ 4] ; coeff |
95 |
lea esp,[esp-24] |
lea esp,[esp-24] |