1 |
;/************************************************************************** |
;/***************************************************************************** |
2 |
; * |
; * |
3 |
; * XVID MPEG-4 VIDEO CODEC |
; * XVID MPEG-4 VIDEO CODEC |
4 |
; * colorspace rgb |
; * - RGB colorspace conversions - |
5 |
|
; * |
6 |
|
; * Copyright(C) 2002-2003 Michael Militzer <isibaar@xvid.org> |
7 |
|
; * 2002-2003 Peter Ross <pross@xvid.org> |
8 |
; * |
; * |
9 |
; * This program is free software; you can redistribute it and/or modify |
; * This program is free software; you can redistribute it and/or modify |
10 |
; * 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 |
18 |
; * |
; * |
19 |
; * You should have received a copy of the GNU General Public License |
; * You should have received a copy of the GNU General Public License |
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., 675 Mass Ave, Cambridge, MA 02139, USA. |
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
; * |
; * |
23 |
; *************************************************************************/ |
; ****************************************************************************/ |
|
|
|
|
;/************************************************************************** |
|
|
; * |
|
|
; * History: |
|
|
; * |
|
|
; * 10.10.2001 initial version; (c)2002 peter ross <pross@xvid.org> |
|
|
; * |
|
|
; *************************************************************************/ |
|
|
|
|
24 |
|
|
25 |
bits 32 |
bits 32 |
26 |
|
|
80 |
UB_MUL dw 129, 129, 129, 129 |
UB_MUL dw 129, 129, 129, 129 |
81 |
VR_MUL dw 102, 102, 102, 102 |
VR_MUL dw 102, 102, 102, 102 |
82 |
|
|
83 |
|
BRIGHT db 128, 128, 128, 128, 128, 128, 128, 128 |
84 |
|
|
85 |
section .text |
section .text |
86 |
|
|
198 |
pxor mm7, mm7 ; clear mm7 |
pxor mm7, mm7 ; clear mm7 |
199 |
%endmacro |
%endmacro |
200 |
|
|
|
|
|
201 |
%macro YV12_TO_BGR 2 |
%macro YV12_TO_BGR 2 |
202 |
%define TEMP_Y1 esp |
%define TEMP_Y1 esp |
203 |
%define TEMP_Y2 esp + 8 |
%define TEMP_Y2 esp + 8 |
205 |
%define TEMP_G2 esp + 24 |
%define TEMP_G2 esp + 24 |
206 |
%define TEMP_B1 esp + 32 |
%define TEMP_B1 esp + 32 |
207 |
%define TEMP_B2 esp + 40 |
%define TEMP_B2 esp + 40 |
208 |
|
|
209 |
movd mm2, [ebx] ; u_ptr[0] |
movd mm2, [ebx] ; u_ptr[0] |
210 |
movd mm3, [ecx] ; v_ptr[0] |
movd mm3, [ecx] ; v_ptr[0] |
211 |
|
|
379 |
psrlq mm0, 32 |
psrlq mm0, 32 |
380 |
|
|
381 |
movd [edi + 15], mm0 |
movd [edi + 15], mm0 |
382 |
movd [edi + 18], mm5 |
movq mm2, mm5 |
383 |
|
|
384 |
|
psrlq mm0, 8 ; 000000r5g5 -> mm0 |
385 |
|
psllq mm2, 32 ; 0r6g6b60000 -> mm2 |
386 |
|
|
387 |
psrlq mm5, 32 |
psrlq mm5, 32 ; 00000r7g7b7 -> mm5 |
388 |
|
psrlq mm2, 16 ; 000r6g6b600 -> mm2 |
389 |
|
|
390 |
movd [edi + 21], mm5 |
por mm0, mm2 ; 000r6g6b6r5g5 -> mm0 |
391 |
|
psllq mm5, 40 ; r7g7b700000 -> mm5 |
392 |
|
|
393 |
|
por mm5, mm0 ; r7g7b7r6g6b6r5g5 -> mm5 |
394 |
|
movq [edi + 16], mm5 |
395 |
|
|
396 |
movq mm0, [TEMP_B2] |
movq mm0, [TEMP_B2] |
397 |
movq mm1, [TEMP_G2] |
movq mm1, [TEMP_G2] |
426 |
psrlq mm0, 32 |
psrlq mm0, 32 |
427 |
|
|
428 |
movd [edi+edx + 15], mm0 |
movd [edi+edx + 15], mm0 |
429 |
movd [edi+edx + 18], mm5 |
movq mm2, mm5 |
430 |
|
|
431 |
|
psrlq mm0, 8 ; 000000r5g5 -> mm0 |
432 |
|
psllq mm2, 32 ; 0r6g6b60000 -> mm2 |
433 |
|
|
434 |
|
psrlq mm5, 32 ; 00000r7g7b7 -> mm5 |
435 |
|
psrlq mm2, 16 ; 000r6g6b600 -> mm2 |
436 |
|
|
437 |
psrlq mm5, 32 |
por mm0, mm2 ; 000r6g6b6r5g5 -> mm0 |
438 |
|
psllq mm5, 40 ; r7g7b700000 -> mm5 |
439 |
|
|
440 |
movd [edi+edx + 21], mm5 |
por mm5, mm0 ; r7g7b7r6g6b6r5g5 -> mm5 |
441 |
|
movq [edi + edx + 16], mm5 |
442 |
|
|
443 |
%else ; BGRA (32-bit) |
%else ; BGRA (32-bit) |
444 |
movq [edi], mm2 |
movq [edi], mm2 |