Commit 2375b094 authored by James Almer's avatar James Almer Committed by Michael Niedermayer

alpha/idctdsp: move idct init code out of dsputil

Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 86359543
OBJS += alpha/blockdsp_alpha.o \
alpha/dsputil_alpha.o \
alpha/dsputil_alpha_asm.o \
alpha/motion_est_alpha.o \
alpha/motion_est_mvi_asm.o \
alpha/simple_idct_alpha.o \
OBJS-$(CONFIG_BLOCKDSP) += alpha/blockdsp_alpha.o
OBJS-$(CONFIG_DSPUTIL) += alpha/dsputil_alpha.o \
alpha/motion_est_alpha.o \
alpha/motion_est_mvi_asm.o
OBJS-$(CONFIG_HPELDSP) += alpha/hpeldsp_alpha.o \
alpha/hpeldsp_alpha_asm.o
OBJS-$(CONFIG_IDCTDSP) += alpha/idctdsp_alpha.o \
alpha/idctdsp_alpha_asm.o \
alpha/simple_idct_alpha.o
OBJS-$(CONFIG_MPEGVIDEO) += alpha/mpegvideo_alpha.o
......@@ -24,11 +24,6 @@
#include "dsputil_alpha.h"
#include "asm.h"
void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
#if 0
/* These functions were the base for the optimized assembler routines,
and remain here for documentation purposes. */
......@@ -107,11 +102,6 @@ av_cold void ff_dsputil_init_alpha(DSPContext *c, AVCodecContext *avctx)
/* amask clears all bits that correspond to present features. */
if (amask(AMASK_MVI) == 0) {
// Disabled as these have been moved to a different context
// Patch to update these is welcome!
// c->put_pixels_clamped = put_pixels_clamped_mvi_asm;
// c->add_pixels_clamped = add_pixels_clamped_mvi_asm;
if (!high_bit_depth)
c->get_pixels = get_pixels_mvi;
c->diff_pixels = diff_pixels_mvi;
......@@ -124,16 +114,4 @@ av_cold void ff_dsputil_init_alpha(DSPContext *c, AVCodecContext *avctx)
c->pix_abs[0][3] = pix_abs16x16_xy2_mvi;
}
// Disabled as these have been moved to a different context
// Patch to update these is welcome!
// put_pixels_clamped_axp_p = c->put_pixels_clamped;
// add_pixels_clamped_axp_p = c->add_pixels_clamped;
//
// if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
// (avctx->idct_algo == FF_IDCT_AUTO ||
// avctx->idct_algo == FF_IDCT_SIMPLEALPHA)) {
// c->idct_put = ff_simple_idct_put_axp;
// c->idct_add = ff_simple_idct_add_axp;
// c->idct = ff_simple_idct_axp;
// }
}
......@@ -22,19 +22,6 @@
#include <stddef.h>
#include <stdint.h>
void ff_simple_idct_axp(int16_t *block);
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block);
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block);
void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
int line_size);
void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
int line_size);
extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
void get_pixels_mvi(int16_t *restrict block,
const uint8_t *restrict pixels, int line_size);
void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2,
......
/*
* Copyright (c) 2002 Falk Hueffner <falk@debian.org>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/attributes.h"
#include "libavcodec/idctdsp.h"
#include "idctdsp_alpha.h"
#include "asm.h"
void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
int line_size);
void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
int line_size);
void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
av_cold void ff_idctdsp_init_alpha(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
/* amask clears all bits that correspond to present features. */
if (amask(AMASK_MVI) == 0) {
c->put_pixels_clamped = put_pixels_clamped_mvi_asm;
c->add_pixels_clamped = add_pixels_clamped_mvi_asm;
}
put_pixels_clamped_axp_p = c->put_pixels_clamped;
add_pixels_clamped_axp_p = c->add_pixels_clamped;
if (!high_bit_depth && !avctx->lowres &&
(avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_SIMPLEALPHA)) {
c->idct_put = ff_simple_idct_put_axp;
c->idct_add = ff_simple_idct_add_axp;
c->idct = ff_simple_idct_axp;
}
}
/*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_ALPHA_IDCTDSP_ALPHA_H
#define AVCODEC_ALPHA_IDCTDSP_ALPHA_H
#include <stddef.h>
#include <stdint.h>
extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
void ff_simple_idct_axp(int16_t *block);
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block);
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block);
#endif /* AVCODEC_ALPHA_IDCTDSP_ALPHA_H */
/*
* Alpha optimized DSP utils
* Alpha optimized IDCT-related routines
* Copyright (c) 2002 Falk Hueffner <falk@debian.org>
*
* This file is part of FFmpeg.
......
......@@ -26,7 +26,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dsputil_alpha.h"
#include "idctdsp_alpha.h"
#include "asm.h"
// cos(i * M_PI / 16) * sqrt(2) * (1 << 14)
......
......@@ -299,6 +299,8 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
c->put_signed_pixels_clamped = put_signed_pixels_clamped_c;
c->add_pixels_clamped = add_pixels_clamped_c;
if (ARCH_ALPHA)
ff_idctdsp_init_alpha(c, avctx, high_bit_depth);
if (ARCH_ARM)
ff_idctdsp_init_arm(c, avctx, high_bit_depth);
if (ARCH_PPC)
......
......@@ -94,6 +94,8 @@ typedef struct IDCTDSPContext {
void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx);
void ff_idctdsp_init_alpha(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment