1 |
;/***************************************************************************** |
;------------------------------------------------------------------------------ |
2 |
; * |
; |
3 |
; * XVID MPEG-4 VIDEO CODEC |
; This file is part of XviD, a free MPEG-4 video encoder/decoder |
4 |
; * mmx yv12 to rgb24 conversion |
; |
5 |
; * |
; XviD is free software; you can redistribute it and/or modify it |
6 |
; * Copyright (C) 2001 - Michael Militzer <isibaar@xvid.org> |
; under the terms of the GNU General Public License as published by |
7 |
; * |
; the Free Software Foundation; either version 2 of the License, or |
8 |
; * This program is an implementation of a part of one or more MPEG-4 |
; (at your option) any later version. |
9 |
; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
; |
10 |
; * to use this software module in hardware or software products are |
; XviD is distributed in the hope that it will be useful, but |
11 |
; * advised that its use may infringe existing patents or copyrights, and |
; WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
; * any such use would be at such party's own risk. The original |
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
; * developer of this software module and his/her company, and subsequent |
; GNU General Public License for more details. |
14 |
; * editors and their companies, will have no liability for use of this |
; |
15 |
; * software or modifications or derivatives thereof. |
; You should have received a copy of the GNU General Public License |
16 |
; * |
; along with this program; if not, write to the Free Software |
17 |
; * This program is free software; you can redistribute it and/or modify |
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 |
; * it under the terms of the GNU General Public License as published by |
; |
19 |
; * the Free Software Foundation; either version 2 of the License, or |
;------------------------------------------------------------------------------ |
20 |
; * (at your option) any later version. |
;------------------------------------------------------------------------------ |
21 |
; * |
; |
22 |
; * This program is distributed in the hope that it will be useful, |
; yuv_to_rgb24.asm, MMX optimized color conversion |
|
; * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
; * GNU General Public License for more details. |
|
|
; * |
|
|
; * You should have received a copy of the GNU General Public License |
|
|
; * along with this program; if not, write to the Free Software |
|
|
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
; * |
|
|
; ****************************************************************************/ |
|
23 |
; |
; |
24 |
|
; Copyright (C) 2001 - Michael Militzer <isibaar@xvid.org> |
25 |
|
; |
26 |
|
; For more information visit the XviD homepage: http://www.xvid.org |
27 |
|
; |
28 |
|
;------------------------------------------------------------------------------ |
29 |
|
;------------------------------------------------------------------------------ |
30 |
|
; |
31 |
|
; Revision history : |
32 |
|
; |
33 |
|
; 13.12.2001 initial version (Isibaar) |
34 |
|
; 23.07.2002 Thread safe version (edgomez) |
35 |
|
; |
36 |
|
; $Id$ |
37 |
|
; |
38 |
|
;------------------------------------------------------------------------------ |
39 |
;------------------------------------------------------------------------------ |
;------------------------------------------------------------------------------ |
40 |
; NB: n contrary to the c implementation this code does the conversion |
; NB: n contrary to the c implementation this code does the conversion |
41 |
; using direct calculations. Input data width must be a multiple of 8 |
; using direct calculations. Input data width must be a multiple of 8 |
144 |
sub ebx, ebp ; y_src2 -> ebx |
sub ebx, ebp ; y_src2 -> ebx |
145 |
|
|
146 |
mov ecx, [esp + 24 + localsize] ; dst_stride -> ecx |
mov ecx, [esp + 24 + localsize] ; dst_stride -> ecx |
147 |
mov edx, ecx |
shl ecx, 1 |
148 |
add ecx, edx |
mov edx, ecx ; 2 * dst_stride -> ecx |
|
shl edx, 2 |
|
|
add ecx, edx ; 6 * dst_stride -> ecx |
|
|
mov edx, ecx |
|
149 |
sub ecx, esi |
sub ecx, esi |
150 |
shl esi, 1 |
shl esi, 1 |
151 |
sub ecx, esi ; 6 * dst_stride - 3 * width -> ecx |
sub ecx, esi ; 2 * dst_stride - 3 * width -> ecx |
152 |
|
|
153 |
mov [dst_dif], ecx |
mov [dst_dif], ecx |
154 |
|
|
206 |
add ebx, ebp ; y_src2 -> ebp |
add ebx, ebp ; y_src2 -> ebp |
207 |
|
|
208 |
mov ecx, [esp + 24 + localsize] ; dst_stride -> ecx |
mov ecx, [esp + 24 + localsize] ; dst_stride -> ecx |
209 |
mov edx, ecx |
shl ecx, 1 |
210 |
add ecx, edx |
mov edx, ecx ; 2 * dst_stride -> ecx |
|
shl edx, 2 |
|
|
add ecx, edx ; 6 * dst_stride -> ecx |
|
|
mov edx, ecx |
|
211 |
sub ecx, esi |
sub ecx, esi |
212 |
shl esi, 1 |
shl esi, 1 |
213 |
sub ecx, esi ; 6 * dst_stride - 3 * width -> ecx |
sub ecx, esi ; 2 * dst_stride - 3 * width -> ecx |
214 |
|
|
215 |
mov [dst_dif], ecx |
mov [dst_dif], ecx |
216 |
|
|