mirror of https://github.com/FFmpeg/FFmpeg.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.9 KiB
61 lines
1.9 KiB
11 years ago
|
/*
|
||
11 years ago
|
* This file is part of FFmpeg.
|
||
11 years ago
|
*
|
||
11 years ago
|
* FFmpeg is free software; you can redistribute it and/or
|
||
11 years ago
|
* modify it under the terms of the GNU Lesser General Public
|
||
|
* License as published by the Free Software Foundation; either
|
||
|
* version 2.1 of the License, or (at your option) any later version.
|
||
|
*
|
||
11 years ago
|
* FFmpeg is distributed in the hope that it will be useful,
|
||
11 years ago
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* Lesser General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Lesser General Public
|
||
11 years ago
|
* License along with FFmpeg; if not, write to the Free Software
|
||
11 years ago
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||
|
*/
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
|
#include "config.h"
|
||
|
#include "libavutil/attributes.h"
|
||
|
#include "libavutil/internal.h"
|
||
|
#include "libavutil/cpu.h"
|
||
|
#include "libavutil/x86/cpu.h"
|
||
|
#include "libavcodec/blockdsp.h"
|
||
|
#include "libavcodec/version.h"
|
||
|
|
||
11 years ago
|
void ff_clear_block_mmx(int16_t *block);
|
||
|
void ff_clear_block_sse(int16_t *block);
|
||
|
void ff_clear_blocks_mmx(int16_t *blocks);
|
||
|
void ff_clear_blocks_sse(int16_t *blocks);
|
||
11 years ago
|
|
||
|
#if FF_API_XVMC
|
||
|
av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth,
|
||
|
AVCodecContext *avctx)
|
||
|
#else
|
||
|
av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth)
|
||
|
#endif /* FF_API_XVMC */
|
||
|
{
|
||
11 years ago
|
#if HAVE_YASM
|
||
11 years ago
|
int cpu_flags = av_get_cpu_flags();
|
||
|
|
||
|
if (!high_bit_depth) {
|
||
11 years ago
|
if (EXTERNAL_MMX(cpu_flags)) {
|
||
11 years ago
|
c->clear_block = ff_clear_block_mmx;
|
||
|
c->clear_blocks = ff_clear_blocks_mmx;
|
||
11 years ago
|
}
|
||
|
|
||
|
/* XvMCCreateBlocks() may not allocate 16-byte aligned blocks */
|
||
11 years ago
|
if (CONFIG_XVMC && avctx->hwaccel && avctx->hwaccel->decode_mb)
|
||
11 years ago
|
return;
|
||
|
|
||
11 years ago
|
if (EXTERNAL_SSE(cpu_flags)) {
|
||
11 years ago
|
c->clear_block = ff_clear_block_sse;
|
||
|
c->clear_blocks = ff_clear_blocks_sse;
|
||
11 years ago
|
}
|
||
|
}
|
||
11 years ago
|
#endif /* HAVE_YASM */
|
||
11 years ago
|
}
|