yading@10
|
1 /*
|
yading@10
|
2 * RV30/40 MMX/SSE2 optimizations
|
yading@10
|
3 * Copyright (C) 2012 Christophe Gisquet <christophe.gisquet@gmail.com>
|
yading@10
|
4 *
|
yading@10
|
5 * This file is part of Libav.
|
yading@10
|
6 *
|
yading@10
|
7 * Libav is free software; you can redistribute it and/or
|
yading@10
|
8 * modify it under the terms of the GNU Lesser General Public
|
yading@10
|
9 * License as published by the Free Software Foundation; either
|
yading@10
|
10 * version 2.1 of the License, or (at your option) any later version.
|
yading@10
|
11 *
|
yading@10
|
12 * Libav is distributed in the hope that it will be useful,
|
yading@10
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
yading@10
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
yading@10
|
15 * Lesser General Public License for more details.
|
yading@10
|
16 *
|
yading@10
|
17 * You should have received a copy of the GNU Lesser General Public
|
yading@10
|
18 * License along with Libav; if not, write to the Free Software
|
yading@10
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
yading@10
|
20 */
|
yading@10
|
21
|
yading@10
|
22 #include "libavutil/cpu.h"
|
yading@10
|
23 #include "libavutil/x86/asm.h"
|
yading@10
|
24 #include "libavutil/x86/cpu.h"
|
yading@10
|
25 #include "libavcodec/rv34dsp.h"
|
yading@10
|
26
|
yading@10
|
27 void ff_rv34_idct_dc_mmxext(int16_t *block);
|
yading@10
|
28 void ff_rv34_idct_dc_noround_mmxext(int16_t *block);
|
yading@10
|
29 void ff_rv34_idct_dc_add_mmx(uint8_t *dst, ptrdiff_t stride, int dc);
|
yading@10
|
30 void ff_rv34_idct_dc_add_sse4(uint8_t *dst, ptrdiff_t stride, int dc);
|
yading@10
|
31 void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block);
|
yading@10
|
32
|
yading@10
|
33 av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
|
yading@10
|
34 {
|
yading@10
|
35 int mm_flags = av_get_cpu_flags();
|
yading@10
|
36
|
yading@10
|
37 if (EXTERNAL_MMX(mm_flags))
|
yading@10
|
38 c->rv34_idct_dc_add = ff_rv34_idct_dc_add_mmx;
|
yading@10
|
39 if (EXTERNAL_MMXEXT(mm_flags)) {
|
yading@10
|
40 c->rv34_inv_transform_dc = ff_rv34_idct_dc_noround_mmxext;
|
yading@10
|
41 c->rv34_idct_add = ff_rv34_idct_add_mmxext;
|
yading@10
|
42 }
|
yading@10
|
43 if (EXTERNAL_SSE4(mm_flags))
|
yading@10
|
44 c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4;
|
yading@10
|
45 }
|