1 |
;/************************************************************************** |
;/**************************************************************************** |
2 |
; * |
; * |
3 |
; * XVID MPEG-4 VIDEO CODEC |
; * XVID MPEG-4 VIDEO CODEC |
4 |
; * mmx cbp calc |
; * - MMX CBP computation - |
5 |
; * |
; * |
6 |
; * This file is part of XviD, a free MPEG-4 video encoder/decoder |
; * Copyright (C) 2001-2003 Peter Ross <pross@xvid.org> |
7 |
|
; * 2002-2003 Pascal Massimino <skal@planet-d.net> |
8 |
; * |
; * |
9 |
; * XviD is free software; you can redistribute it and/or modify it |
; * This program is free software ; you can redistribute it and/or modify |
10 |
; * 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 |
11 |
; * the Free Software Foundation; either version 2 of the License, or |
; * the Free Software Foundation; either version 2 of the License, or |
12 |
; * (at your option) any later version. |
; * (at your option) any later version. |
13 |
; * |
; * |
20 |
; * along with this program; if not, write to the Free Software |
; * along with this program; if not, write to the Free Software |
21 |
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
; * |
; * |
23 |
; * Under section 8 of the GNU General Public License, the copyright |
; * $Id: cbp_mmx.asm,v 1.11 2004-08-22 11:46:09 edgomez Exp $ |
|
; * holders of XVID explicitly forbid distribution in the following |
|
|
; * countries: |
|
|
; * |
|
|
; * - Japan |
|
|
; * - United States of America |
|
|
; * |
|
|
; * Linking XviD statically or dynamically with other modules is making a |
|
|
; * combined work based on XviD. Thus, the terms and conditions of the |
|
|
; * GNU General Public License cover the whole combination. |
|
|
; * |
|
|
; * As a special exception, the copyright holders of XviD give you |
|
|
; * permission to link XviD with independent modules that communicate with |
|
|
; * XviD solely through the VFW1.1 and DShow interfaces, regardless of the |
|
|
; * license terms of these independent modules, and to copy and distribute |
|
|
; * the resulting combined work under terms of your choice, provided that |
|
|
; * every copy of the combined work is accompanied by a complete copy of |
|
|
; * the source code of XviD (the version of XviD used to produce the |
|
|
; * combined work), being distributed under the terms of the GNU General |
|
|
; * Public License plus this exception. An independent module is a module |
|
|
; * which is not derived from or based on XviD. |
|
|
; * |
|
|
; * Note that people who make modified versions of XviD are not obligated |
|
|
; * to grant this special exception for their modified versions; it is |
|
|
; * their choice whether to do so. The GNU General Public License gives |
|
|
; * permission to release a modified version without this exception; this |
|
|
; * exception also makes it possible to release a modified version which |
|
|
; * carries forward this exception. |
|
24 |
; * |
; * |
25 |
; * $Id: cbp_mmx.asm,v 1.7 2002-11-17 00:57:57 edgomez Exp $ |
; ***************************************************************************/ |
|
; * |
|
|
; *************************************************************************/ |
|
26 |
|
|
27 |
bits 32 |
BITS 32 |
28 |
|
|
29 |
section .data |
;============================================================================= |
30 |
|
; Macros |
31 |
|
;============================================================================= |
32 |
|
|
33 |
%macro cglobal 1 |
%macro cglobal 1 |
34 |
%ifdef PREFIX |
%ifdef PREFIX |
35 |
|
%ifdef MARK_FUNCS |
36 |
|
global _%1:function |
37 |
|
%define %1 _%1:function |
38 |
|
%else |
39 |
global _%1 |
global _%1 |
40 |
%define %1 _%1 |
%define %1 _%1 |
41 |
|
%endif |
42 |
|
%else |
43 |
|
%ifdef MARK_FUNCS |
44 |
|
global %1:function |
45 |
%else |
%else |
46 |
global %1 |
global %1 |
47 |
%endif |
%endif |
48 |
|
%endif |
49 |
%endmacro |
%endmacro |
50 |
|
|
51 |
align 16 |
;============================================================================= |
52 |
|
; Local data |
53 |
|
;============================================================================= |
54 |
|
|
55 |
|
%ifdef FORMAT_COFF |
56 |
|
SECTION .rodata |
57 |
|
%else |
58 |
|
SECTION .rodata align=16 |
59 |
|
%endif |
60 |
|
|
61 |
|
ALIGN 16 |
62 |
|
|
63 |
|
ignore_dc: |
64 |
|
dw 0, -1, -1, -1, -1, -1, -1, -1 |
65 |
|
|
66 |
ignore_dc dw 0, -1, -1, -1, -1, -1, -1, -1 |
;============================================================================= |
67 |
|
; Code |
68 |
|
;============================================================================= |
69 |
|
|
70 |
section .text |
SECTION .text |
71 |
|
|
72 |
cglobal calc_cbp_mmx |
cglobal calc_cbp_mmx |
73 |
|
|
74 |
;=========================================================================== |
;----------------------------------------------------------------------------- |
|
; |
|
75 |
; uint32_t calc_cbp_mmx(const int16_t coeff[6][64]); |
; uint32_t calc_cbp_mmx(const int16_t coeff[6][64]); |
76 |
; |
;----------------------------------------------------------------------------- |
|
;=========================================================================== |
|
77 |
|
|
78 |
align 16 |
ALIGN 16 |
79 |
calc_cbp_mmx: |
calc_cbp_mmx: |
80 |
push ebx |
push ebx |
81 |
push esi |
push esi |