bswapdsp
cabac
dsputil
+ fdctdsp
gcrypt
golomb
gplv3
# subsystems
dct_select="rdft"
-dsputil_select="idctdsp"
+dsputil_select="fdctdsp idctdsp"
error_resilience_select="dsputil"
intrax8_select="error_resilience"
mdct_select="fft"
amv_decoder_select="sp5x_decoder"
ape_decoder_select="bswapdsp"
asv1_decoder_select="blockdsp bswapdsp idctdsp"
-asv1_encoder_select="bswapdsp dsputil"
+asv1_encoder_select="bswapdsp dsputil fdctdsp"
asv2_decoder_select="blockdsp bswapdsp idctdsp"
-asv2_encoder_select="bswapdsp dsputil"
+asv2_encoder_select="bswapdsp dsputil fdctdsp"
atrac1_decoder_select="mdct sinewin"
atrac3_decoder_select="mdct"
atrac3p_decoder_select="mdct sinewin"
cscd_decoder_suggest="zlib"
dca_decoder_select="mdct"
dnxhd_decoder_select="blockdsp idctdsp"
-dnxhd_encoder_select="aandcttables blockdsp dsputil idctdsp mpegvideoenc"
+dnxhd_encoder_select="aandcttables blockdsp dsputil fdctdsp idctdsp mpegvideoenc"
dvvideo_decoder_select="idctdsp"
-dvvideo_encoder_select="dsputil"
+dvvideo_encoder_select="dsputil fdctdsp"
dxa_decoder_deps="zlib"
eac3_decoder_select="ac3_decoder"
eac3_encoder_select="ac3_encoder"
png_encoder_deps="zlib"
png_encoder_select="huffyuvencdsp"
prores_decoder_select="idctdsp"
-prores_encoder_select="dsputil"
+prores_encoder_select="fdctdsp"
qcelp_decoder_select="lsp"
qdm2_decoder_select="mdct rdft mpegaudiodsp"
ra_144_encoder_select="audio_frame_queue lpc"
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
OBJS-$(CONFIG_DSPUTIL) += dsputil.o
OBJS-$(CONFIG_DXVA2) += dxva2.o
-OBJS-$(CONFIG_ENCODERS) += faandct.o jfdctfst.o jfdctint.o
OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o
+OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o faandct.o \
+ jfdctfst.o jfdctint.o
FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
$(FFT-OBJS-yes)
#include "blockdsp.h"
#include "bswapdsp.h"
#include "dsputil.h"
+#include "fdctdsp.h"
#include "idctdsp.h"
#include "get_bits.h"
#include "put_bits.h"
BlockDSPContext bdsp;
BswapDSPContext bbdsp;
DSPContext dsp;
+ FDCTDSPContext fdsp;
IDCTDSPContext idsp;
PutBitContext pb;
GetBitContext gb;
#include "asv.h"
#include "avcodec.h"
+#include "fdctdsp.h"
#include "mathops.h"
#include "mpeg12data.h"
a->dsp.get_pixels(block[2], ptr_y + 8*linesize , linesize);
a->dsp.get_pixels(block[3], ptr_y + 8*linesize + 8, linesize);
for(i=0; i<4; i++)
- a->dsp.fdct(block[i]);
+ a->fdsp.fdct(block[i]);
if(!(a->avctx->flags&CODEC_FLAG_GRAY)){
a->dsp.get_pixels(block[4], ptr_cb, frame->linesize[1]);
a->dsp.get_pixels(block[5], ptr_cr, frame->linesize[2]);
for(i=4; i<6; i++)
- a->dsp.fdct(block[i]);
+ a->fdsp.fdct(block[i]);
}
}
ff_asv_common_init(avctx);
ff_dsputil_init(&a->dsp, avctx);
+ ff_fdctdsp_init(&a->fdsp, avctx);
if(avctx->global_quality == 0) avctx->global_quality= 4*FF_QUALITY_SCALE;
#include "avcodec.h"
#include "blockdsp.h"
#include "dsputil.h"
+#include "fdctdsp.h"
#include "internal.h"
#include "mpegvideo.h"
#include "dnxhdenc.h"
int last_non_zero = 0;
int i;
- ctx->dsp.fdct(block);
+ ctx->fdsp.fdct(block);
// Divide by 4 with rounding, to compensate scaling of DCT coefficients
block[0] = (block[0] + 2) >> 2;
ff_blockdsp_init(&ctx->bdsp, avctx);
ff_dsputil_init(&ctx->m.dsp, avctx);
+ ff_fdctdsp_init(&ctx->m.fdsp, avctx);
ff_idctdsp_init(&ctx->m.idsp, avctx);
ff_mpegvideoencdsp_init(&ctx->m.mpvencdsp, avctx);
ff_dct_common_init(&ctx->m);
#include "libavutil/attributes.h"
#include "avcodec.h"
#include "copy_block.h"
-#include "dct.h"
#include "dsputil.h"
#include "simple_idct.h"
-#include "faandct.h"
#include "mpegvideo.h"
#include "config.h"
assert(h == 8);
s->dsp.diff_pixels(temp, src1, src2, stride);
- s->dsp.fdct(temp);
+ s->fdsp.fdct(temp);
return s->dsp.sum_abs_dctelem(temp);
}
assert(h == 8);
s->dsp.diff_pixels(temp, src1, src2, stride);
- s->dsp.fdct(temp);
+ s->fdsp.fdct(temp);
for (i = 0; i < 64; i++)
sum = FFMAX(sum, FFABS(temp[i]));
{
const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
-#if CONFIG_ENCODERS
- if (avctx->bits_per_raw_sample == 10) {
- c->fdct = ff_jpeg_fdct_islow_10;
- c->fdct248 = ff_fdct248_islow_10;
- } else {
- if (avctx->dct_algo == FF_DCT_FASTINT) {
- c->fdct = ff_fdct_ifast;
- c->fdct248 = ff_fdct_ifast248;
- } else if (avctx->dct_algo == FF_DCT_FAAN) {
- c->fdct = ff_faandct;
- c->fdct248 = ff_faandct248;
- } else {
- c->fdct = ff_jpeg_fdct_islow_8; // slow/accurate/default
- c->fdct248 = ff_fdct248_islow_8;
- }
- }
-#endif /* CONFIG_ENCODERS */
-
c->diff_pixels = diff_pixels_c;
c->sum_abs_dctelem = sum_abs_dctelem_c;
me_cmp_func frame_skip_cmp[6]; // only width 8 used
me_cmp_func pix_abs[2][4];
-
- /* (I)DCT */
- void (*fdct)(int16_t *block /* align 16 */);
- void (*fdct248)(int16_t *block /* align 16 */);
} DSPContext;
void ff_dsputil_static_init(void);
#include "config.h"
#include "avcodec.h"
#include "dsputil.h"
+#include "fdctdsp.h"
#include "internal.h"
#include "put_bits.h"
#include "dv.h"
{
DVVideoContext *s = avctx->priv_data;
DSPContext dsp;
+ FDCTDSPContext fdsp;
int ret;
s->sys = avpriv_dv_codec_profile(avctx);
dv_vlc_map_tableinit();
ff_dsputil_init(&dsp, avctx);
+ ff_fdctdsp_init(&fdsp, avctx);
ff_set_cmp(&dsp, dsp.ildct_cmp, avctx->ildct_cmp);
s->get_pixels = dsp.get_pixels;
s->ildct_cmp = dsp.ildct_cmp[5];
- s->fdct[0] = dsp.fdct;
- s->fdct[1] = dsp.fdct248;
+ s->fdct[0] = fdsp.fdct;
+ s->fdct[1] = fdsp.fdct248;
return ff_dvvideo_init(avctx);
}
--- /dev/null
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * 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.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * 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
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/attributes.h"
+#include "avcodec.h"
+#include "dct.h"
+#include "faandct.h"
+#include "fdctdsp.h"
+#include "config.h"
+
+av_cold void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx)
+{
+ const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
+
+ if (avctx->bits_per_raw_sample == 10) {
+ c->fdct = ff_jpeg_fdct_islow_10;
+ c->fdct248 = ff_fdct248_islow_10;
+ } else {
+ if (avctx->dct_algo == FF_DCT_FASTINT) {
+ c->fdct = ff_fdct_ifast;
+ c->fdct248 = ff_fdct_ifast248;
+ } else if (avctx->dct_algo == FF_DCT_FAAN) {
+ c->fdct = ff_faandct;
+ c->fdct248 = ff_faandct248;
+ } else {
+ c->fdct = ff_jpeg_fdct_islow_8; // slow/accurate/default
+ c->fdct248 = ff_fdct248_islow_8;
+ }
+ }
+
+ if (ARCH_PPC)
+ ff_fdctdsp_init_ppc(c, avctx, high_bit_depth);
+ if (ARCH_X86)
+ ff_fdctdsp_init_x86(c, avctx, high_bit_depth);
+}
--- /dev/null
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * 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.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * 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
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_FDCTDSP_H
+#define AVCODEC_FDCTDSP_H
+
+#include <stdint.h>
+
+#include "avcodec.h"
+
+typedef struct FDCTDSPContext {
+ void (*fdct)(int16_t *block /* align 16 */);
+ void (*fdct248)(int16_t *block /* align 16 */);
+} FDCTDSPContext;
+
+void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx);
+void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
+void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth);
+
+#endif /* AVCODEC_FDCTDSP_H */
#include "blockdsp.h"
#include "dsputil.h"
#include "error_resilience.h"
+#include "fdctdsp.h"
#include "get_bits.h"
#include "h263dsp.h"
#include "hpeldsp.h"
BlockDSPContext bdsp;
DSPContext dsp; ///< pointers for accelerated dsp functions
+ FDCTDSPContext fdsp;
HpelDSPContext hdsp;
IDCTDSPContext idsp;
MpegVideoDSPContext mdsp;
const uint16_t *quant_matrix,
int bias, int qmin, int qmax, int intra)
{
- DSPContext *dsp = &s->dsp;
+ FDCTDSPContext *fdsp = &s->fdsp;
int qscale;
int shift = 0;
for (qscale = qmin; qscale <= qmax; qscale++) {
int i;
- if (dsp->fdct == ff_jpeg_fdct_islow_8 ||
- dsp->fdct == ff_jpeg_fdct_islow_10 ||
- dsp->fdct == ff_faandct) {
+ if (fdsp->fdct == ff_jpeg_fdct_islow_8 ||
+ fdsp->fdct == ff_jpeg_fdct_islow_10 ||
+ fdsp->fdct == ff_faandct) {
for (i = 0; i < 64; i++) {
const int j = s->idsp.idct_permutation[i];
/* 16 <= qscale * quant_matrix[i] <= 7905
qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) /
(qscale * quant_matrix[j]));
}
- } else if (dsp->fdct == ff_fdct_ifast) {
+ } else if (fdsp->fdct == ff_fdct_ifast) {
for (i = 0; i < 64; i++) {
const int j = s->idsp.idct_permutation[i];
/* 16 <= qscale * quant_matrix[i] <= 7905
for (i = intra; i < 64; i++) {
int64_t max = 8191;
- if (dsp->fdct == ff_fdct_ifast) {
+ if (fdsp->fdct == ff_fdct_ifast) {
max = (8191LL * ff_aanscales[i]) >> 14;
}
while (((max * qmat[qscale][i]) >> shift) > INT_MAX) {
if (ARCH_X86)
ff_MPV_encode_init_x86(s);
+ ff_fdctdsp_init(&s->fdsp, avctx);
ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx);
ff_qpeldsp_init(&s->qdsp);
uint8_t * last_length;
const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
- s->dsp.fdct (block);
+ s->fdsp.fdct(block);
if(s->dct_error_sum)
s->denoise_dct(s, block);
int dct_coeff= FFABS(block[ scantable[i] ]);
int best_score=256*256*256*120;
- if (s->dsp.fdct == ff_fdct_ifast)
+ if (s->fdsp.fdct == ff_fdct_ifast)
dct_coeff= (dct_coeff*ff_inv_aanscales[ scantable[i] ]) >> 12;
zero_distortion= dct_coeff*dct_coeff;
STOP_TIMER("rem*w*w")}
{START_TIMER
#endif
- s->dsp.fdct(d1);
+ s->fdsp.fdct(d1);
#ifdef REFINE_STATS
STOP_TIMER("dct")}
#endif
int max=0;
unsigned int threshold1, threshold2;
- s->dsp.fdct (block);
+ s->fdsp.fdct(block);
if(s->dct_error_sum)
s->denoise_dct(s, block);
OBJS-$(CONFIG_H264QPEL) += ppc/h264qpel.o
OBJS-$(CONFIG_HPELDSP) += ppc/hpeldsp_altivec.o
OBJS-$(CONFIG_HUFFYUVDSP) += ppc/huffyuvdsp_altivec.o
+OBJS-$(CONFIG_FDCTDSP) += ppc/fdctdsp.o
OBJS-$(CONFIG_IDCTDSP) += ppc/idctdsp.o
OBJS-$(CONFIG_MPEGAUDIODSP) += ppc/mpegaudiodsp_altivec.o
OBJS-$(CONFIG_MPEGVIDEO) += ppc/mpegvideo_altivec.o \
OBJS-$(CONFIG_VP8_DECODER) += ppc/vp8dsp_altivec.o
ALTIVEC-OBJS-$(CONFIG_DSPUTIL) += ppc/dsputil_altivec.o \
- ppc/fdct_altivec.o \
FFT-OBJS-$(HAVE_GNU_AS) += ppc/fft_altivec_s.o
ALTIVEC-OBJS-$(CONFIG_FFT) += $(FFT-OBJS-yes)
#include "libavcodec/dsputil.h"
-void ff_fdct_altivec(int16_t *block);
-
void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
{
if (PPC_ALTIVEC(av_get_cpu_flags())) {
ff_dsputil_init_altivec(c, avctx, high_bit_depth);
-
- if (!high_bit_depth) {
-#if CONFIG_ENCODERS
- if (avctx->dct_algo == FF_DCT_AUTO ||
- avctx->dct_algo == FF_DCT_ALTIVEC) {
- c->fdct = ff_fdct_altivec;
- }
-#endif //CONFIG_ENCODERS
- }
}
}
#include <altivec.h>
#endif
-#include "libavutil/common.h"
-#include "dsputil_altivec.h"
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+#include "libavcodec/fdctdsp.h"
+#include "fdctdsp.h"
+
+#if HAVE_ALTIVEC
#define vs16(v) ((vector signed short) (v))
#define vs32(v) ((vector signed int) (v))
#undef CTS
/* }}} */
}
+
+#endif /* HAVE_ALTIVEC */
+
+av_cold void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+#if HAVE_ALTIVEC
+ if (!PPC_ALTIVEC(av_get_cpu_flags()))
+ return;
+
+ if (!high_bit_depth) {
+ if (avctx->dct_algo == FF_DCT_AUTO ||
+ avctx->dct_algo == FF_DCT_ALTIVEC) {
+ c->fdct = ff_fdct_altivec;
+ }
+ }
+#endif /* HAVE_ALTIVEC */
+}
--- /dev/null
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * 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.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * 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
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_PPC_FDCTDSP_H
+#define AVCODEC_PPC_FDCTDSP_H
+
+#include <stdint.h>
+
+void ff_fdct_altivec(int16_t *block);
+
+#endif /* AVCODEC_PPC_FDCTDSP_H */
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
-#include "dct.h"
-#include "dsputil.h"
+#include "fdctdsp.h"
#include "put_bits.h"
#include "bytestream.h"
#include "internal.h"
const uint8_t *quant_mat;
const uint8_t *scantable;
- void (* fdct)(DSPContext *dsp, const uint16_t *src,
- int linesize, int16_t *block);
- DSPContext dsp;
+ void (*fdct)(FDCTDSPContext *fdsp, const uint16_t *src,
+ int linesize, int16_t *block);
+ FDCTDSPContext fdsp;
int mb_width, mb_height;
int mbs_per_slice;
mb_width * sizeof(*emu_buf));
}
if (!is_chroma) {
- ctx->fdct(&ctx->dsp, esrc, elinesize, blocks);
+ ctx->fdct(&ctx->fdsp, esrc, elinesize, blocks);
blocks += 64;
if (blocks_per_mb > 2) {
- ctx->fdct(&ctx->dsp, esrc + 8, elinesize, blocks);
+ ctx->fdct(&ctx->fdsp, esrc + 8, elinesize, blocks);
blocks += 64;
}
- ctx->fdct(&ctx->dsp, esrc + elinesize * 4, elinesize, blocks);
+ ctx->fdct(&ctx->fdsp, esrc + elinesize * 4, elinesize, blocks);
blocks += 64;
if (blocks_per_mb > 2) {
- ctx->fdct(&ctx->dsp, esrc + elinesize * 4 + 8, elinesize, blocks);
+ ctx->fdct(&ctx->fdsp, esrc + elinesize * 4 + 8, elinesize, blocks);
blocks += 64;
}
} else {
- ctx->fdct(&ctx->dsp, esrc, elinesize, blocks);
+ ctx->fdct(&ctx->fdsp, esrc, elinesize, blocks);
blocks += 64;
- ctx->fdct(&ctx->dsp, esrc + elinesize * 4, elinesize, blocks);
+ ctx->fdct(&ctx->fdsp, esrc + elinesize * 4, elinesize, blocks);
blocks += 64;
if (blocks_per_mb > 2) {
- ctx->fdct(&ctx->dsp, esrc + 8, elinesize, blocks);
+ ctx->fdct(&ctx->fdsp, esrc + 8, elinesize, blocks);
blocks += 64;
- ctx->fdct(&ctx->dsp, esrc + elinesize * 4 + 8, elinesize, blocks);
+ ctx->fdct(&ctx->fdsp, esrc + elinesize * 4 + 8, elinesize, blocks);
blocks += 64;
}
}
return 0;
}
-static void prores_fdct(DSPContext *dsp, const uint16_t *src,
+static void prores_fdct(FDCTDSPContext *fdsp, const uint16_t *src,
int linesize, int16_t *block)
{
int x, y;
block[y * 8 + x] = tsrc[x];
tsrc += linesize >> 1;
}
- dsp->fdct(block);
+ fdsp->fdct(block);
}
static av_cold int encode_init(AVCodecContext *avctx)
ctx->fdct = prores_fdct;
ctx->scantable = interlaced ? ff_prores_interlaced_scan
: ff_prores_progressive_scan;
- ff_dsputil_init(&ctx->dsp, avctx);
+ ff_fdctdsp_init(&ctx->fdsp, avctx);
mps = ctx->mbs_per_slice;
if (mps & (mps - 1)) {
OBJS-$(CONFIG_DSPUTIL) += x86/dsputil_init.o
OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o \
x86/motion_est.o
+OBJS-$(CONFIG_FDCTDSP) += x86/fdctdsp_init.o
OBJS-$(CONFIG_FFT) += x86/fft_init.o
OBJS-$(CONFIG_H263DSP) += x86/h263dsp_init.o
OBJS-$(CONFIG_H264CHROMA) += x86/h264chroma_init.o
OBJS-$(CONFIG_VP9_DECODER) += x86/vp9dsp_init.o
MMX-OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp_mmx.o
-MMX-OBJS-$(CONFIG_ENCODERS) += x86/fdct.o
MMX-OBJS-$(CONFIG_HPELDSP) += x86/fpel_mmx.o \
x86/hpeldsp_mmx.o
+MMX-OBJS-$(CONFIG_FDCTDSP) += x86/fdct.o
MMX-OBJS-$(CONFIG_IDCTDSP) += x86/idctdsp_mmx.o \
x86/idct_mmx_xvid.o \
x86/idct_sse2_xvid.o \
#include "libavutil/cpu.h"
#include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
-#include "libavcodec/dct.h"
#include "libavcodec/dsputil.h"
#include "libavcodec/mpegvideo.h"
#include "dsputil_x86.h"
unsigned high_bit_depth)
{
int cpu_flags = av_get_cpu_flags();
- const int dct_algo = avctx->dct_algo;
if (EXTERNAL_MMX(cpu_flags)) {
if (!high_bit_depth)
#if HAVE_INLINE_ASM
if (INLINE_MMX(cpu_flags)) {
- if (!high_bit_depth &&
- (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
- c->fdct = ff_fdct_mmx;
-
c->sum_abs_dctelem = sum_abs_dctelem_mmx;
c->sse[0] = sse16_mmx;
}
if (INLINE_MMXEXT(cpu_flags)) {
- if (!high_bit_depth &&
- (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
- c->fdct = ff_fdct_mmxext;
-
c->sum_abs_dctelem = sum_abs_dctelem_mmxext;
c->vsad[4] = vsad_intra16_mmxext;
}
if (INLINE_SSE2(cpu_flags)) {
- if (!high_bit_depth &&
- (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
- c->fdct = ff_fdct_sse2;
-
c->sum_abs_dctelem = sum_abs_dctelem_sse2;
}
--- /dev/null
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * 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.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * 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
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/x86/cpu.h"
+#include "libavcodec/avcodec.h"
+#include "libavcodec/dct.h"
+#include "libavcodec/fdctdsp.h"
+
+av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
+ unsigned high_bit_depth)
+{
+ int cpu_flags = av_get_cpu_flags();
+ const int dct_algo = avctx->dct_algo;
+
+ if (!high_bit_depth) {
+ if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
+ if (INLINE_MMX(cpu_flags))
+ c->fdct = ff_fdct_mmx;
+
+ if (INLINE_MMXEXT(cpu_flags))
+ c->fdct = ff_fdct_mmxext;
+
+ if (INLINE_SSE2(cpu_flags))
+ c->fdct = ff_fdct_sse2;
+ }
+ }
+}