Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1008)

Unified Diff: media/base/simd/yuv_row.inc

Issue 7003082: Implements RGB to YV12 conversion in YASM. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/simd/yuv_row.inc
===================================================================
--- media/base/simd/yuv_row.inc (revision 0)
+++ media/base/simd/yuv_row.inc (revision 0)
@@ -0,0 +1,101 @@
+; Copyright (c) 2011 The Chromium Authors. All rights reserved.
Alpha Left Google 2011/08/22 14:16:59 Rename this to yuv_row_common_sse2.inc, there migh
+; Use of this source code is governed by a BSD-style license that can be
+; found in the LICENSE file.
+
+%ifndef MEDIA_BASE_SIMD_COMMON_INC_
Alpha Left Google 2011/08/22 14:16:59 This should be MEDIA_BASE_YUV_ROW_COMMON_SSE2_INC_
+%define MEDIA_BASE_SIMD_COMMON_INC_
+
+%define EXTN(name) name ; foo() -> foo
+
+%ifdef MACHO
+%define PRIVATE :private_extern
+%elifdef ELF
+%define PRIVATE :hidden
+%else
+%define PRIVATE
+%endif
+
+%ifdef MACHO
+%define SEG_TEXT .text align=16
+%define SEG_CONST .rodata align=16
+%elifdef ELF
+%ifdef __x86_64__
+%define SEG_TEXT .text progbits align=16
+%define SEG_CONST .rodata progbits align=16
+%else
+%define SEG_TEXT .text progbits alloc exec nowrite align=16
+%define SEG_CONST .rodata progbits alloc noexec nowrite align=16
+%endif
+%elifdef MSVC
+%define SEG_TEXT .text align=16
+%define SEG_CONST .rdata align=16
+%endif
+
+%define SIZEOF_BYTE 1 ; sizeof(BYTE)
+%define SIZEOF_WORD 2 ; sizeof(WORD)
+%define SIZEOF_DWORD 4 ; sizeof(DWORD)
+%define SIZEOF_QWORD 8 ; sizeof(QWORD)
+%define SIZEOF_DQWORD 16 ; sizeof(DQWORD)
+
+%ifdef __x86_64__
+%define POINTER qword ; general pointer type
+%define SIZEOF_POINTER SIZEOF_QWORD ; sizeof(POINTER)
+%define POINTER_BIT QWORD_BIT ; sizeof(POINTER) * BYTE_BIT
+%else
+%define POINTER dword ; general pointer type
+%define SIZEOF_POINTER SIZEOF_DWORD ; sizeof(POINTER)
+%define POINTER_BIT DWORD_BIT ; sizeof(POINTER) * BYTE_BIT
+%endif
+
+%define INT dword ; signed integer type
+%define SIZEOF_INT SIZEOF_DWORD ; sizeof(INT)
+%define INT_BIT DWORD_BIT ; sizeof(INT) * BYTE_BIT
+
+%define MMWORD qword ; int64 (MMX register)
+%define SIZEOF_MMWORD SIZEOF_QWORD ; sizeof(MMWORD)
+%define MMWORD_BIT QWORD_BIT ; sizeof(MMWORD) * BYTE_BIT
+%define XMMWORD ; int128 (SSE register)
+%define SIZEOF_XMMWORD SIZEOF_DQWORD ; sizeof(XMMWORD)
+%define XMMWORD_BIT DQWORD_BIT ; sizeof(XMMWORD) * BYTE_BIT
+
+; Aliases for x86 registers.
+%ifdef __x86_64__
+%define _EAX_ rax
+%define _EBX_ rbx
+%define _ECX_ rcx
+%define _EDX_ rdx
+%define _ESI_ rsi
+%define _EDI_ rdi
+%define _ESP_ rsp
+%define _EBP_ rbp
+%else
+%define _EAX_ eax
+%define _EBX_ ebx
+%define _ECX_ ecx
+%define _EDX_ edx
+%define _ESI_ esi
+%define _EDI_ edi
+%define _ESP_ esp
+%define _EBP_ ebp
+%endif
+
+; LOADSYM register, symbol
+; Copies the address to a local symbol to the specified register.
Alpha Left Google 2011/08/22 14:16:59 Do a one liner to explain why we need to do this:
+%ifdef MACHO
Alpha Left Google 2011/08/22 14:16:59 Both Linux and Mac uses PIC.
+; We create a PIC binary on Mac.
+%imacro LOADSYM 2
+ call %%geteip
+ add %1, %2 - $
+ jmp %%end
+%%geteip:
+ mov %1, POINTER [_ESP_]
+ ret
+%%end:
+%endmacro
+%else
+%imacro LOADSYM 2
Alpha Left Google 2011/08/22 14:16:59 Do a one liner explanation here.
+ lea %1, [%2]
+%endmacro
+%endif ; MACHO
+
+%endif ; MEDIA_BASE_SIMD_COMMON_INC_
Alpha Left Google 2011/08/22 14:16:59 This one needs to change too.

Powered by Google App Engine
This is Rietveld 408576698