FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
huffyuvencdsp_init.c
Go to the documentation of this file.
1 /*
2  * SIMD-optimized HuffYUV encoding functions
3  * Copyright (c) 2000, 2001 Fabrice Bellard
4  * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
5  *
6  * MMX optimization by Nick Kurshev <nickols_k@mail.ru>
7  *
8  * This file is part of FFmpeg.
9  *
10  * FFmpeg is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * FFmpeg is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with FFmpeg; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  */
24 
25 #include "libavutil/attributes.h"
26 #include "libavutil/cpu.h"
27 #include "libavutil/pixdesc.h"
28 #include "libavutil/x86/cpu.h"
30 
31 void ff_diff_int16_mmx (uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
32  unsigned mask, int w);
33 void ff_diff_int16_sse2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
34  unsigned mask, int w);
35 void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
36  unsigned mask, int w, int *left, int *left_top);
37 
39 {
41  const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(avctx->pix_fmt);
42 
43  if (ARCH_X86_32 && EXTERNAL_MMX(cpu_flags)) {
45  }
46 
47  if (EXTERNAL_MMXEXT(cpu_flags) && pix_desc && pix_desc->comp[0].depth<16) {
49  }
50 
51  if (EXTERNAL_SSE2(cpu_flags)) {
53  }
54 }
#define EXTERNAL_MMX(flags)
Definition: cpu.h:56
void(* sub_hfyu_median_pred_int16)(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w, int *left, int *left_top)
Definition: huffyuvencdsp.h:32
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2419
av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, AVCodecContext *avctx)
void(* diff_int16)(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w)
Definition: huffyuvencdsp.h:27
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1989
static atomic_int cpu_flags
Definition: cpu.c:50
Macro definitions for various function/variable attributes.
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:117
#define av_cold
Definition: attributes.h:82
#define EXTERNAL_SSE2(flags)
Definition: cpu.h:59
static const uint16_t mask[17]
Definition: lzw.c:38
void ff_diff_int16_mmx(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w)
void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w, int *left, int *left_top)
#define src1
Definition: h264pred.c:139
void ff_diff_int16_sse2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
main external API structure.
Definition: avcodec.h:1761
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:92
#define EXTERNAL_MMXEXT(flags)
Definition: cpu.h:57
static double c[64]
int depth
Number of bits in the component.
Definition: pixdesc.h:58
#define av_unused
Definition: attributes.h:125