1 ;*****************************************************************************
2 ;* predict-a.asm: h264 encoder library
3 ;*****************************************************************************
4 ;* Copyright (C) 2005 x264 project
6 ;* This program is free software; you can redistribute it and/or modify
7 ;* it under the terms of the GNU General Public License as published by
8 ;* the Free Software Foundation; either version 2 of the License, or
9 ;* (at your option) any later version.
11 ;* This program is distributed in the hope that it will be useful,
12 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;* GNU General Public License for more details.
16 ;* You should have received a copy of the GNU General Public License
17 ;* along with this program; if not, write to the Free Software
18 ;* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
19 ;*****************************************************************************
23 ;=============================================================================
24 ; Macros and other preprocessor constants
25 ;=============================================================================
36 ;=============================================================================
38 ;=============================================================================
45 ;=============================================================================
47 ;=============================================================================
51 cglobal predict_8x8c_v_mmx
52 cglobal predict_16x16_v_mmx
54 ;-----------------------------------------------------------------------------
56 ; void predict_8x8c_v_mmx( uint8_t *src, int i_stride )
58 ;-----------------------------------------------------------------------------
62 movsxd rcx, esi ; i_stride
64 sub rdi , rcx ; esi <-- line -1
67 movq [rdi + rcx] , mm0 ; 0
68 movq [rdi + 2 * rcx] , mm0 ; 1
69 movq [rdi + 4 * rcx] , mm0 ; 3
70 movq [rdi + 8 * rcx] , mm0 ; 7
71 add rdi , rcx ; esi <-- line 0
72 movq [rdi + 2 * rcx] , mm0 ; 2
73 movq [rdi + 4 * rcx] , mm0 ; 4
74 lea rdi , [rdi + 4 * rcx] ; esi <-- line 4
75 movq [rdi + rcx] , mm0 ; 5
76 movq [rdi + 2 * rcx] , mm0 ; 6
80 ;-----------------------------------------------------------------------------
82 ; void predict_16x16_v_mmx( uint8_t *src, int i_stride )
84 ;-----------------------------------------------------------------------------
88 movsxd rcx, esi ; i_stride
90 sub rdi, rcx ; esi <-- line -1
94 lea rax, [rcx + 2 * rcx] ; rax <-- 3* stride
96 SAVE_0_1 (rdi + rcx) ; 0
97 SAVE_0_1 (rdi + 2 * rcx) ; 1
98 SAVE_0_1 (rdi + rax) ; 2
99 SAVE_0_1 (rdi + 4 * rcx) ; 3
100 SAVE_0_1 (rdi + 2 * rax) ; 5
101 SAVE_0_1 (rdi + 8 * rcx) ; 7
102 SAVE_0_1 (rdi + 4 * rax) ; 11
103 add rdi, rcx ; esi <-- line 0
104 SAVE_0_1 (rdi + 4 * rcx) ; 4
105 SAVE_0_1 (rdi + 2 * rax) ; 6
106 SAVE_0_1 (rdi + 8 * rcx) ; 8
107 SAVE_0_1 (rdi + 4 * rax) ; 12
108 lea rdi, [rdi + 8 * rcx] ; esi <-- line 8
109 SAVE_0_1 (rdi + rcx) ; 9
110 SAVE_0_1 (rdi + 2 * rcx) ; 10
111 lea rdi, [rdi + 4 * rcx] ; esi <-- line 12
112 SAVE_0_1 (rdi + rcx) ; 13
113 SAVE_0_1 (rdi + 2 * rcx) ; 14
114 SAVE_0_1 (rdi + rax) ; 15