00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "libavutil/cpu.h"
00020 #include "libavcodec/v210dec.h"
00021
00022 extern void ff_v210_planar_unpack_unaligned_ssse3(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
00023 extern void ff_v210_planar_unpack_unaligned_avx(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
00024
00025 extern void ff_v210_planar_unpack_aligned_ssse3(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
00026 extern void ff_v210_planar_unpack_aligned_avx(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
00027
00028 av_cold void v210_x86_init(V210DecContext *s)
00029 {
00030 int cpu_flags = av_get_cpu_flags();
00031
00032 #if HAVE_YASM
00033 if (s->aligned_input) {
00034 if (cpu_flags & AV_CPU_FLAG_SSSE3)
00035 s->unpack_frame = ff_v210_planar_unpack_aligned_ssse3;
00036
00037 if (HAVE_AVX && cpu_flags & AV_CPU_FLAG_AVX)
00038 s->unpack_frame = ff_v210_planar_unpack_aligned_avx;
00039 }
00040 else {
00041 if (cpu_flags & AV_CPU_FLAG_SSSE3)
00042 s->unpack_frame = ff_v210_planar_unpack_unaligned_ssse3;
00043
00044 if (HAVE_AVX && cpu_flags & AV_CPU_FLAG_AVX)
00045 s->unpack_frame = ff_v210_planar_unpack_unaligned_avx;
00046 }
00047 #endif
00048 }