Commit e3fcb143 authored by Diego Biurrun's avatar Diego Biurrun
Browse files

dsputil: Split off IDCT bits into their own context

parent adcb8392
......@@ -1546,6 +1546,7 @@ CONFIG_EXTRA="
huffman
huffyuvdsp
huffyuvencdsp
idctdsp
intrax8
lgplv3
lpc
......@@ -1703,6 +1704,7 @@ threads_if_any="$THREADS_LIST"
# subsystems
dct_select="rdft"
dsputil_select="idctdsp"
error_resilience_select="dsputil"
intrax8_select="error_resilience"
mdct_select="fft"
......@@ -1710,7 +1712,7 @@ rdft_select="fft"
mpeg_er_select="error_resilience"
mpegaudio_select="mpegaudiodsp"
mpegaudiodsp_select="dct"
mpegvideo_select="blockdsp dsputil hpeldsp videodsp"
mpegvideo_select="blockdsp dsputil hpeldsp idctdsp videodsp"
mpegvideoenc_select="dsputil mpegvideo qpeldsp"
# decoders / encoders
......@@ -1720,16 +1722,16 @@ aac_latm_decoder_select="aac_decoder aac_latm_parser"
ac3_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
ac3_encoder_select="ac3dsp audiodsp dsputil mdct"
ac3_fixed_encoder_select="ac3dsp audiodsp dsputil mdct"
aic_decoder_select="dsputil golomb"
aic_decoder_select="golomb idctdsp"
alac_encoder_select="lpc"
als_decoder_select="bswapdsp"
amrnb_decoder_select="lsp"
amrwb_decoder_select="lsp"
amv_decoder_select="sp5x_decoder"
ape_decoder_select="bswapdsp"
asv1_decoder_select="blockdsp bswapdsp dsputil"
asv1_decoder_select="blockdsp bswapdsp idctdsp"
asv1_encoder_select="bswapdsp dsputil"
asv2_decoder_select="blockdsp bswapdsp dsputil"
asv2_decoder_select="blockdsp bswapdsp idctdsp"
asv2_encoder_select="bswapdsp dsputil"
atrac1_decoder_select="mdct sinewin"
atrac3_decoder_select="mdct"
......@@ -1737,23 +1739,23 @@ atrac3p_decoder_select="mdct sinewin"
bink_decoder_select="blockdsp hpeldsp"
binkaudio_dct_decoder_select="mdct rdft dct sinewin"
binkaudio_rdft_decoder_select="mdct rdft sinewin"
cavs_decoder_select="blockdsp dsputil golomb h264chroma qpeldsp videodsp"
cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
cllc_decoder_select="bswapdsp"
comfortnoise_encoder_select="lpc"
cook_decoder_select="audiodsp mdct sinewin"
cscd_decoder_select="lzo"
cscd_decoder_suggest="zlib"
dca_decoder_select="mdct"
dnxhd_decoder_select="blockdsp dsputil"
dnxhd_encoder_select="aandcttables blockdsp dsputil mpegvideoenc"
dvvideo_decoder_select="dsputil"
dnxhd_decoder_select="blockdsp idctdsp"
dnxhd_encoder_select="aandcttables blockdsp dsputil idctdsp mpegvideoenc"
dvvideo_decoder_select="idctdsp"
dvvideo_encoder_select="dsputil"
dxa_decoder_deps="zlib"
eac3_decoder_select="ac3_decoder"
eac3_encoder_select="ac3_encoder"
eamad_decoder_select="aandcttables blockdsp bswapdsp dsputil mpegvideo"
eatgq_decoder_select="aandcttables dsputil"
eatqi_decoder_select="aandcttables blockdsp bswapdsp dsputil mpeg1video_decoder"
eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
eatgq_decoder_select="aandcttables idctdsp"
eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpeg1video_decoder"
exr_decoder_deps="zlib"
ffv1_decoder_select="golomb rangecoder"
ffv1_encoder_select="rangecoder"
......@@ -1770,7 +1772,7 @@ flv_encoder_select="h263_encoder"
fourxm_decoder_select="blockdsp bswapdsp"
fraps_decoder_select="bswapdsp huffman"
g2m_decoder_deps="zlib"
g2m_decoder_select="blockdsp dsputil"
g2m_decoder_select="blockdsp idctdsp"
h261_decoder_select="mpeg_er mpegvideo"
h261_encoder_select="aandcttables mpegvideoenc"
h263_decoder_select="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpeldsp"
......@@ -1790,12 +1792,12 @@ jpegls_decoder_select="golomb mjpeg_decoder"
jpegls_encoder_select="golomb"
jv_decoder_select="blockdsp"
lagarith_decoder_select="huffyuvdsp"
ljpeg_encoder_select="aandcttables dsputil"
ljpeg_encoder_select="aandcttables idctdsp"
loco_decoder_select="golomb"
mdec_decoder_select="blockdsp dsputil mpegvideo"
mdec_decoder_select="blockdsp idctdsp mpegvideo"
metasound_decoder_select="lsp mdct sinewin"
mimic_decoder_select="blockdsp bswapdsp dsputil hpeldsp"
mjpeg_decoder_select="blockdsp dsputil hpeldsp"
mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
mjpeg_decoder_select="blockdsp hpeldsp idctdsp"
mjpeg_encoder_select="aandcttables mpegvideoenc"
mjpegb_decoder_select="mjpeg_decoder"
mlp_decoder_select="mlp_parser"
......@@ -1829,13 +1831,13 @@ mss2_decoder_select="error_resilience mpeg_er qpeldsp vc1_decoder"
mxpeg_decoder_select="mjpeg_decoder"
nellymoser_decoder_select="mdct sinewin"
nellymoser_encoder_select="audio_frame_queue mdct sinewin"
nuv_decoder_select="dsputil lzo"
nuv_decoder_select="idctdsp lzo"
on2avc_decoder_select="mdct"
opus_decoder_deps="avresample"
png_decoder_deps="zlib"
png_encoder_deps="zlib"
png_encoder_select="huffyuvencdsp"
prores_decoder_select="dsputil"
prores_decoder_select="idctdsp"
prores_encoder_select="dsputil"
qcelp_decoder_select="lsp"
qdm2_decoder_select="mdct rdft mpegaudiodsp"
......@@ -1888,7 +1890,7 @@ wmav2_encoder_select="mdct sinewin"
wmavoice_decoder_select="lsp rdft dct mdct sinewin"
wmv1_decoder_select="h263_decoder"
wmv1_encoder_select="h263_encoder"
wmv2_decoder_select="blockdsp h263_decoder intrax8 videodsp"
wmv2_decoder_select="blockdsp h263_decoder idctdsp intrax8 videodsp"
wmv2_encoder_select="h263_encoder"
wmv3_decoder_select="vc1_decoder"
wmv3image_decoder_select="wmv3_decoder"
......
......@@ -136,9 +136,6 @@ dct_unquantize_mpeg2
dct_unquantize_h263
Used in MPEG-4/H.263 en/decoding.
FIXME remaining functions?
BTW, most of these functions are in dsputil.c/.h, some are in mpegvideo.c/.h.
Alignment:
......
......@@ -33,9 +33,8 @@ OBJS-$(CONFIG_BLOCKDSP) += blockdsp.o
OBJS-$(CONFIG_BSWAPDSP) += bswapdsp.o
OBJS-$(CONFIG_CABAC) += cabac.o
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
OBJS-$(CONFIG_DSPUTIL) += dsputil.o
OBJS-$(CONFIG_DXVA2) += dxva2.o
OBJS-$(CONFIG_DSPUTIL) += dsputil.o faanidct.o \
simple_idct.o jrevdct.o
OBJS-$(CONFIG_ENCODERS) += faandct.o jfdctfst.o jfdctint.o
OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o
FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
......@@ -51,6 +50,8 @@ OBJS-$(CONFIG_HPELDSP) += hpeldsp.o
OBJS-$(CONFIG_HUFFMAN) += huffman.o
OBJS-$(CONFIG_HUFFYUVDSP) += huffyuvdsp.o
OBJS-$(CONFIG_HUFFYUVENCDSP) += huffyuvencdsp.o
OBJS-$(CONFIG_IDCTDSP) += idctdsp.o faanidct.o \
simple_idct.o jrevdct.o
OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o
OBJS-$(CONFIG_LIBXVID) += libxvid_rc.o
OBJS-$(CONFIG_LPC) += lpc.o
......
......@@ -24,10 +24,10 @@
#include "avcodec.h"
#include "bytestream.h"
#include "dsputil.h"
#include "internal.h"
#include "get_bits.h"
#include "golomb.h"
#include "idctdsp.h"
#include "unary.h"
#define AIC_HDR_SIZE 24
......@@ -139,7 +139,7 @@ static const uint8_t *aic_scan[NUM_BANDS] = {
typedef struct AICContext {
AVCodecContext *avctx;
AVFrame *frame;
DSPContext dsp;
IDCTDSPContext idsp;
ScanTable scantable;
int num_x_slices;
......@@ -336,16 +336,15 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
recombine_block_il(ctx->block, ctx->scantable.permutated,
&base_y, &ext_y, blk);
unquant_block(ctx->block, ctx->quant);
ctx->dsp.idct(ctx->block);
ctx->idsp.idct(ctx->block);
if (!ctx->interlaced) {
dst = Y + (blk >> 1) * 8 * ystride + (blk & 1) * 8;
ctx->dsp.put_signed_pixels_clamped(ctx->block, dst,
ystride);
ctx->idsp.put_signed_pixels_clamped(ctx->block, dst, ystride);
} else {
dst = Y + (blk & 1) * 8 + (blk >> 1) * ystride;
ctx->dsp.put_signed_pixels_clamped(ctx->block, dst,
ystride * 2);
ctx->idsp.put_signed_pixels_clamped(ctx->block, dst,
ystride * 2);
}
}
Y += 16;
......@@ -354,9 +353,9 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
recombine_block(ctx->block, ctx->scantable.permutated,
&base_c, &ext_c);
unquant_block(ctx->block, ctx->quant);
ctx->dsp.idct(ctx->block);
ctx->dsp.put_signed_pixels_clamped(ctx->block, C[blk],
ctx->frame->linesize[blk + 1]);
ctx->idsp.idct(ctx->block);
ctx->idsp.put_signed_pixels_clamped(ctx->block, C[blk],
ctx->frame->linesize[blk + 1]);
C[blk] += 8;
}
}
......@@ -426,11 +425,11 @@ static av_cold int aic_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
ff_dsputil_init(&ctx->dsp, avctx);
ff_idctdsp_init(&ctx->idsp, avctx);
for (i = 0; i < 64; i++)
scan[i] = i;
ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, scan);
ff_init_scantable(ctx->idsp.idct_permutation, &ctx->scantable, scan);
ctx->mb_width = FFALIGN(avctx->width, 16) >> 4;
ctx->mb_height = FFALIGN(avctx->height, 16) >> 4;
......
......@@ -6,10 +6,7 @@ OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \
arm/ac3dsp_arm.o
OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o
OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o
OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_arm.o \
arm/dsputil_arm.o \
arm/jrevdct_arm.o \
arm/simple_idct_arm.o
OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_arm.o
OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o \
arm/fft_fixed_init_arm.o
OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o
......@@ -18,6 +15,10 @@ OBJS-$(CONFIG_H264PRED) += arm/h264pred_init_arm.o
OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_init_arm.o
OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_arm.o \
arm/hpeldsp_arm.o
OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_arm.o \
arm/idctdsp_arm.o \
arm/jrevdct_arm.o \
arm/simple_idct_arm.o
OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o
OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o
OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o
......@@ -40,7 +41,7 @@ OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_init_arm.o
OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \
arm/rv40dsp_init_arm.o
ARMV5TE-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv5te.o \
ARMV5TE-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv5te.o \
arm/simple_idct_armv5te.o
ARMV5TE-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_armv5te.o \
arm/mpegvideo_armv5te_s.o
......@@ -51,11 +52,13 @@ ARMV5TE-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv5te.o
ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o
ARMV6-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_armv6.o \
arm/dsputil_armv6.o \
arm/simple_idct_armv6.o
arm/dsputil_armv6.o
ARMV6-OBJS-$(CONFIG_H264DSP) += arm/h264dsp_armv6.o
ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \
arm/hpeldsp_armv6.o
ARMV6-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv6.o \
arm/idctdsp_armv6.o \
arm/simple_idct_armv6.o
ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o
ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o
......@@ -83,9 +86,6 @@ NEON-OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_neon.o \
arm/int_neon.o
NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \
arm/blockdsp_neon.o
NEON-OBJS-$(CONFIG_DSPUTIL) += arm/dsputil_init_neon.o \
arm/dsputil_neon.o \
arm/simple_idct_neon.o
NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \
arm/fft_fixed_neon.o
NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o
......@@ -96,6 +96,9 @@ NEON-OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_neon.o \
arm/hpeldsp_neon.o
NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \
arm/hpeldsp_neon.o
NEON-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_neon.o \
arm/idctdsp_neon.o \
arm/simple_idct_neon.o
NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \
arm/mdct_fixed_neon.o
NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o
......
......@@ -24,11 +24,7 @@
#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
#endif /* AVCODEC_ARM_DSPUTIL_ARM_H */
......@@ -20,33 +20,6 @@
#include "libavutil/arm/asm.S"
function ff_add_pixels_clamped_armv6, export=1
push {r4-r8,lr}
mov r3, #8
1:
ldm r0!, {r4,r5,r12,lr}
ldrd r6, r7, [r1]
pkhbt r8, r4, r5, lsl #16
pkhtb r5, r5, r4, asr #16
pkhbt r4, r12, lr, lsl #16
pkhtb lr, lr, r12, asr #16
pld [r1, r2]
uxtab16 r8, r8, r6
uxtab16 r5, r5, r6, ror #8
uxtab16 r4, r4, r7
uxtab16 lr, lr, r7, ror #8
usat16 r8, #8, r8
usat16 r5, #8, r5
usat16 r4, #8, r4
usat16 lr, #8, lr
orr r6, r8, r5, lsl #8
orr r7, r4, lr, lsl #8
subs r3, r3, #1
strd_post r6, r7, r1, r2
bgt 1b
pop {r4-r8,pc}
endfunc
function ff_get_pixels_armv6, export=1
pld [r1, r2]
push {r4-r8, lr}
......
......@@ -28,71 +28,11 @@
#include "libavcodec/dsputil.h"
#include "dsputil_arm.h"
void ff_j_rev_dct_arm(int16_t *data);
void ff_simple_idct_arm(int16_t *data);
/* XXX: local hack */
static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
int line_size);
/* XXX: those functions should be suppressed ASAP when all IDCTs are
* converted */
static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct_arm(block);
ff_put_pixels_clamped(block, dest, line_size);
}
static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct_arm(block);
ff_add_pixels_clamped(block, dest, line_size);
}
static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_simple_idct_arm(block);
ff_put_pixels_clamped(block, dest, line_size);
}
static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_simple_idct_arm(block);
ff_add_pixels_clamped(block, dest, line_size);
}
av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
int cpu_flags = av_get_cpu_flags();
ff_put_pixels_clamped = c->put_pixels_clamped;
ff_add_pixels_clamped = c->add_pixels_clamped;
if (!high_bit_depth) {
if (avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_ARM) {
c->idct_put = j_rev_dct_arm_put;
c->idct_add = j_rev_dct_arm_add;
c->idct = ff_j_rev_dct_arm;
c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
} else if (avctx->idct_algo == FF_IDCT_SIMPLEARM) {
c->idct_put = simple_idct_arm_put;
c->idct_add = simple_idct_arm_add;
c->idct = ff_simple_idct_arm;
c->idct_permutation_type = FF_NO_IDCT_PERM;
}
}
c->add_pixels_clamped = ff_add_pixels_clamped_arm;
if (have_armv5te(cpu_flags))
ff_dsputil_init_armv5te(c, avctx, high_bit_depth);
if (have_armv6(cpu_flags))
ff_dsputil_init_armv6(c, avctx, high_bit_depth);
if (have_neon(cpu_flags))
ff_dsputil_init_neon(c, avctx, high_bit_depth);
}
......@@ -26,13 +26,6 @@
#include "libavcodec/mpegvideo.h"
#include "dsputil_arm.h"
void ff_simple_idct_armv6(int16_t *data);
void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels,
int line_size);
void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride);
void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1,
const uint8_t *s2, int stride);
......@@ -56,17 +49,6 @@ int ff_pix_sum_armv6(uint8_t *pix, int line_size);
av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
if (!high_bit_depth) {
if (avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_SIMPLEARMV6) {
c->idct_put = ff_simple_idct_put_armv6;
c->idct_add = ff_simple_idct_add_armv6;
c->idct = ff_simple_idct_armv6;
c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
}
}
c->add_pixels_clamped = ff_add_pixels_clamped_armv6;
if (!high_bit_depth)
c->get_pixels = ff_get_pixels_armv6;
c->diff_pixels = ff_diff_pixels_armv6;
......
@
@ ARMv4 optimized DSP utils
@ ARMv4-optimized IDCT functions
@ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp>
@
@ This file is part of Libav.
......
/*
* Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
*
* 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_ARM_IDCTDSP_ARM_H
#define AVCODEC_ARM_IDCTDSP_ARM_H
#include "libavcodec/avcodec.h"
#include "libavcodec/idctdsp.h"
void ff_idctdsp_init_armv5te(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_idctdsp_init_neon(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
#endif /* AVCODEC_ARM_IDCTDSP_ARM_H */
/*
* Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
*
* 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/arm/asm.S"
function ff_add_pixels_clamped_armv6, export=1
push {r4-r8,lr}
mov r3, #8
1:
ldm r0!, {r4,r5,r12,lr}
ldrd r6, r7, [r1]
pkhbt r8, r4, r5, lsl #16
pkhtb r5, r5, r4, asr #16
pkhbt r4, r12, lr, lsl #16
pkhtb lr, lr, r12, asr #16
pld [r1, r2]
uxtab16 r8, r8, r6
uxtab16 r5, r5, r6, ror #8
uxtab16 r4, r4, r7
uxtab16 lr, lr, r7, ror #8
usat16 r8, #8, r8
usat16 r5, #8, r5
usat16 r4, #8, r4
usat16 lr, #8, lr
orr r6, r8, r5, lsl #8
orr r7, r4, lr, lsl #8
subs r3, r3, #1
strd_post r6, r7, r1, r2
bgt 1b
pop {r4-r8,pc}
endfunc
/*
* ARM-optimized IDCT functions
* Copyright (c) 2001 Lionel Ulmer
*
* 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 <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/arm/cpu.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/idctdsp.h"
#include "idctdsp_arm.h"
void ff_j_rev_dct_arm(int16_t *data);
void ff_simple_idct_arm(int16_t *data);
/* XXX: local hack */
static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
int line_size);
/* XXX: those functions should be suppressed ASAP when all IDCTs are
* converted */
static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct_arm(block);
ff_put_pixels_clamped(block, dest, line_size);
}
static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct_arm(block);
ff_add_pixels_clamped(block, dest, line_size);
}
static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_simple_idct_arm(block);