Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
libavcodec
x86
dnxhdenc.c
Go to the documentation of this file.
1
/*
2
* VC3/DNxHD SIMD functions
3
* Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
4
*
5
* VC-3 encoder funded by the British Broadcasting Corporation
6
*
7
* This file is part of Libav.
8
*
9
* Libav is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Lesser General Public
11
* License as published by the Free Software Foundation; either
12
* version 2.1 of the License, or (at your option) any later version.
13
*
14
* Libav is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Lesser General Public License for more details.
18
*
19
* You should have received a copy of the GNU Lesser General Public
20
* License along with Libav; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
*/
23
24
#include "
libavutil/x86/asm.h
"
25
#include "
libavcodec/dnxhdenc.h
"
26
27
#if HAVE_SSE2_INLINE
28
29
static
void
get_pixels_8x4_sym_sse2(
DCTELEM
*
block
,
const
uint8_t
*pixels,
int
line_size)
30
{
31
__asm__
volatile
(
32
"pxor %%xmm5, %%xmm5 \n\t"
33
"movq (%0), %%xmm0 \n\t"
34
"add %2, %0 \n\t"
35
"movq (%0), %%xmm1 \n\t"
36
"movq (%0, %2), %%xmm2 \n\t"
37
"movq (%0, %2,2), %%xmm3 \n\t"
38
"punpcklbw %%xmm5, %%xmm0 \n\t"
39
"punpcklbw %%xmm5, %%xmm1 \n\t"
40
"punpcklbw %%xmm5, %%xmm2 \n\t"
41
"punpcklbw %%xmm5, %%xmm3 \n\t"
42
"movdqa %%xmm0, (%1) \n\t"
43
"movdqa %%xmm1, 16(%1) \n\t"
44
"movdqa %%xmm2, 32(%1) \n\t"
45
"movdqa %%xmm3, 48(%1) \n\t"
46
"movdqa %%xmm3 , 64(%1) \n\t"
47
"movdqa %%xmm2 , 80(%1) \n\t"
48
"movdqa %%xmm1 , 96(%1) \n\t"
49
"movdqa %%xmm0, 112(%1) \n\t"
50
:
"+r"
(pixels)
51
:
"r"
(block),
"r"
((
x86_reg
)line_size)
52
);
53
}
54
55
#endif
/* HAVE_SSE2_INLINE */
56
57
void
ff_dnxhdenc_init_x86
(
DNXHDEncContext
*ctx)
58
{
59
#if HAVE_SSE2_INLINE
60
if
(
av_get_cpu_flags
() &
AV_CPU_FLAG_SSE2
) {
61
if
(ctx->
cid_table
->
bit_depth
== 8)
62
ctx->
get_pixels_8x4_sym
= get_pixels_8x4_sym_sse2;
63
}
64
#endif
/* HAVE_SSE2_INLINE */
65
}
asm.h
ff_dnxhdenc_init_x86
void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
Definition:
dnxhdenc.c:57
uint8_t
uint8_t
Definition:
audio_convert.c:194
dnxhdenc.h
block
static DCTELEM block[64]
Definition:
dct-test.c:169
AV_CPU_FLAG_SSE2
#define AV_CPU_FLAG_SSE2
DNXHDEncContext::get_pixels_8x4_sym
void(* get_pixels_8x4_sym)(DCTELEM *, const uint8_t *, int)
Definition:
dnxhdenc.h:95
CIDEntry::bit_depth
int bit_depth
Definition:
dnxhddata.h:35
DNXHDEncContext
Definition:
dnxhdenc.h:42
DNXHDEncContext::cid_table
const CIDEntry * cid_table
Definition:
dnxhdenc.h:48
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition:
cpu.c:25
DCTELEM
short DCTELEM
Definition:
dsputil.h:39
x86_reg
int x86_reg
Definition:
asm.h:68