aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-02-01 14:43:06 +0100
committerDiego Biurrun <diego@biurrun.de>2012-02-08 08:52:30 +0100
commit0144fe69951a10587769cfc76554d5f7f473eccb (patch)
treeffa60f0f1722b91cd758e52f6a26f2fd195e2462 /libavcodec
parent9b027c0d0794b50e3b638cca4bed925638ab68bc (diff)
downloadffmpeg-0144fe69951a10587769cfc76554d5f7f473eccb.tar.gz
Remove Sun medialib glue code.
It is obscure, most likely unused and not bit-exact compared to libavcodec due to a different IDCT transform algorithm.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/Makefile4
-rw-r--r--libavcodec/avcodec.h2
-rw-r--r--libavcodec/dsputil.c1
-rw-r--r--libavcodec/dsputil.h1
-rw-r--r--libavcodec/mlib/dsputil_mlib.c469
-rw-r--r--libavcodec/mpegvideo.c2
-rw-r--r--libavcodec/mpegvideo.h1
-rw-r--r--libavcodec/options.c2
8 files changed, 1 insertions, 481 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 6308e829f0..fbb09eefff 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -663,8 +663,6 @@ OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
OBJS-$(HAVE_PTHREADS) += pthread.o
OBJS-$(HAVE_W32THREADS) += pthread.o
-OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
-
# inverse.o contains the ff_inverse table definition, which is used by
# the FASTDIV macro (from libavutil); since referencing the external
# table has a negative effect on performance, copy it in libavcodec as
@@ -696,7 +694,7 @@ HOSTPROGS = aac_tablegen aacps_tablegen cbrt_tablegen cos_tablegen \
dv_tablegen motionpixels_tablegen mpegaudio_tablegen \
pcm_tablegen qdm2_tablegen sinewin_tablegen
-DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
+DIRS = alpha arm bfin ppc ps2 sh4 sparc x86
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 05e8b9c05b..b60e7be243 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1680,7 +1680,6 @@ typedef struct AVCodecContext {
#define FF_DCT_FASTINT 1
#define FF_DCT_INT 2
#define FF_DCT_MMX 3
-#define FF_DCT_MLIB 4
#define FF_DCT_ALTIVEC 5
#define FF_DCT_FAAN 6
@@ -1731,7 +1730,6 @@ typedef struct AVCodecContext {
#define FF_IDCT_SIMPLEMMX 3
#define FF_IDCT_LIBMPEG2MMX 4
#define FF_IDCT_PS2 5
-#define FF_IDCT_MLIB 6
#define FF_IDCT_ARM 7
#define FF_IDCT_ALTIVEC 8
#define FF_IDCT_SH4 9
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index a72bd89323..9f282416d4 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -3138,7 +3138,6 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
if (HAVE_MMX) dsputil_init_mmx (c, avctx);
if (ARCH_ARM) dsputil_init_arm (c, avctx);
- if (CONFIG_MLIB) dsputil_init_mlib (c, avctx);
if (HAVE_VIS) dsputil_init_vis (c, avctx);
if (ARCH_ALPHA) dsputil_init_alpha (c, avctx);
if (ARCH_PPC) dsputil_init_ppc (c, avctx);
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index cadde7d25a..786a0effcb 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -643,7 +643,6 @@ static inline int get_penalty_factor(int lambda, int lambda2, int type){
void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
void dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
-void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx);
void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx);
void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx);
void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx);
diff --git a/libavcodec/mlib/dsputil_mlib.c b/libavcodec/mlib/dsputil_mlib.c
deleted file mode 100644
index bfa5153def..0000000000
--- a/libavcodec/mlib/dsputil_mlib.c
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * Sun mediaLib optimized DSP utils
- * Copyright (c) 2001 Fabrice Bellard
- *
- * 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 "libavcodec/dsputil.h"
-#include "libavcodec/mpegvideo.h"
-
-#include <mlib_types.h>
-#include <mlib_status.h>
-#include <mlib_sys.h>
-#include <mlib_algebra.h>
-#include <mlib_video.h>
-
-/* misc */
-
-static void get_pixels_mlib(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
-{
- int i;
-
- for (i=0;i<8;i++) {
- mlib_VectorConvert_S16_U8_Mod((mlib_s16 *)block, (mlib_u8 *)pixels, 8);
-
- pixels += line_size;
- block += 8;
- }
-}
-
-static void diff_pixels_mlib(DCTELEM *restrict block, const uint8_t *s1, const uint8_t *s2, int line_size)
-{
- int i;
-
- for (i=0;i<8;i++) {
- mlib_VectorSub_S16_U8_Mod((mlib_s16 *)block, (mlib_u8 *)s1, (mlib_u8 *)s2, 8);
-
- s1 += line_size;
- s2 += line_size;
- block += 8;
- }
-}
-
-static void add_pixels_clamped_mlib(const DCTELEM *block, uint8_t *pixels, int line_size)
-{
- mlib_VideoAddBlock_U8_S16(pixels, (mlib_s16 *)block, line_size);
-}
-
-/* put block, width 16 pixel, height 8/16 */
-
-static void put_pixels16_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoCopyRef_U8_U8_16x8(dest, (uint8_t *)ref, stride);
- break;
-
- case 16:
- mlib_VideoCopyRef_U8_U8_16x16(dest, (uint8_t *)ref, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels16_x2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpX_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpX_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels16_y2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels16_xy2_mlib(uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpXY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpXY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-/* put block, width 8 pixel, height 4/8/16 */
-
-static void put_pixels8_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoCopyRef_U8_U8_8x4(dest, (uint8_t *)ref, stride);
- break;
-
- case 8:
- mlib_VideoCopyRef_U8_U8_8x8(dest, (uint8_t *)ref, stride);
- break;
-
- case 16:
- mlib_VideoCopyRef_U8_U8_8x16(dest, (uint8_t *)ref, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels8_x2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpX_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpX_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpX_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels8_y2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels8_xy2_mlib(uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpXY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpXY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpXY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-/* average block, width 16 pixel, height 8/16 */
-
-static void avg_pixels16_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoCopyRefAve_U8_U8_16x8(dest, (uint8_t *)ref, stride);
- break;
-
- case 16:
- mlib_VideoCopyRefAve_U8_U8_16x16(dest, (uint8_t *)ref, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels16_x2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpAveX_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveX_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels16_y2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpAveY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels16_xy2_mlib(uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpAveXY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveXY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-/* average block, width 8 pixel, height 4/8/16 */
-
-static void avg_pixels8_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoCopyRefAve_U8_U8_8x4(dest, (uint8_t *)ref, stride);
- break;
-
- case 8:
- mlib_VideoCopyRefAve_U8_U8_8x8(dest, (uint8_t *)ref, stride);
- break;
-
- case 16:
- mlib_VideoCopyRefAve_U8_U8_8x16(dest, (uint8_t *)ref, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels8_x2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpAveX_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpAveX_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveX_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels8_y2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpAveY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpAveY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels8_xy2_mlib(uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpAveXY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpAveXY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveXY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-/* swap byte order of a buffer */
-
-static void bswap_buf_mlib(uint32_t *dst, const uint32_t *src, int w)
-{
- mlib_VectorReverseByteOrder_U32_U32(dst, src, w);
-}
-
-/* transformations */
-
-static void ff_idct_put_mlib(uint8_t *dest, int line_size, DCTELEM *data)
-{
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- mlib_VideoIDCT8x8_S16_S16 (data, data);
-
- for(i=0;i<8;i++) {
- dest[0] = cm[data[0]];
- dest[1] = cm[data[1]];
- dest[2] = cm[data[2]];
- dest[3] = cm[data[3]];
- dest[4] = cm[data[4]];
- dest[5] = cm[data[5]];
- dest[6] = cm[data[6]];
- dest[7] = cm[data[7]];
-
- dest += line_size;
- data += 8;
- }
-}
-
-static void ff_idct_add_mlib(uint8_t *dest, int line_size, DCTELEM *data)
-{
- mlib_VideoIDCT8x8_S16_S16 (data, data);
- mlib_VideoAddBlock_U8_S16(dest, (mlib_s16 *)data, line_size);
-}
-
-static void ff_idct_mlib(DCTELEM *data)
-{
- mlib_VideoIDCT8x8_S16_S16 (data, data);
-}
-
-static void ff_fdct_mlib(DCTELEM *data)
-{
- mlib_VideoDCT8x8_S16_S16 (data, data);
-}
-
-void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx)
-{
- const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
- c->diff_pixels = diff_pixels_mlib;
- c->add_pixels_clamped = add_pixels_clamped_mlib;
-
- if (!high_bit_depth) {
- c->get_pixels = get_pixels_mlib;
-
- c->put_pixels_tab[0][0] = put_pixels16_mlib;
- c->put_pixels_tab[0][1] = put_pixels16_x2_mlib;
- c->put_pixels_tab[0][2] = put_pixels16_y2_mlib;
- c->put_pixels_tab[0][3] = put_pixels16_xy2_mlib;
- c->put_pixels_tab[1][0] = put_pixels8_mlib;
- c->put_pixels_tab[1][1] = put_pixels8_x2_mlib;
- c->put_pixels_tab[1][2] = put_pixels8_y2_mlib;
- c->put_pixels_tab[1][3] = put_pixels8_xy2_mlib;
-
- c->avg_pixels_tab[0][0] = avg_pixels16_mlib;
- c->avg_pixels_tab[0][1] = avg_pixels16_x2_mlib;
- c->avg_pixels_tab[0][2] = avg_pixels16_y2_mlib;
- c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mlib;
- c->avg_pixels_tab[1][0] = avg_pixels8_mlib;
- c->avg_pixels_tab[1][1] = avg_pixels8_x2_mlib;
- c->avg_pixels_tab[1][2] = avg_pixels8_y2_mlib;
- c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mlib;
-
- c->put_no_rnd_pixels_tab[0][0] = put_pixels16_mlib;
- c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib;
- }
-
- c->bswap_buf = bswap_buf_mlib;
-}
-
-void MPV_common_init_mlib(MpegEncContext *s)
-{
- if(s->avctx->dct_algo==FF_DCT_AUTO || s->avctx->dct_algo==FF_DCT_MLIB){
- s->dsp.fdct = ff_fdct_mlib;
- }
-
- if(s->avctx->idct_algo==FF_IDCT_MLIB){
- s->dsp.idct_put= ff_idct_put_mlib;
- s->dsp.idct_add= ff_idct_add_mlib;
- s->dsp.idct = ff_idct_mlib;
- s->dsp.idct_permutation_type= FF_NO_IDCT_PERM;
- }
-}
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 50e6ad6da4..d1c06c0b01 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -191,8 +191,6 @@ av_cold int ff_dct_common_init(MpegEncContext *s)
MPV_common_init_mmx(s);
#elif ARCH_ALPHA
MPV_common_init_axp(s);
-#elif CONFIG_MLIB
- MPV_common_init_mlib(s);
#elif HAVE_MMI
MPV_common_init_mmi(s);
#elif ARCH_ARM
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 3473e6d8f7..3d3b237898 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -697,7 +697,6 @@ int MPV_encode_end(AVCodecContext *avctx);
int MPV_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data);
void MPV_common_init_mmx(MpegEncContext *s);
void MPV_common_init_axp(MpegEncContext *s);
-void MPV_common_init_mlib(MpegEncContext *s);
void MPV_common_init_mmi(MpegEncContext *s);
void MPV_common_init_arm(MpegEncContext *s);
void MPV_common_init_altivec(MpegEncContext *s);
diff --git a/libavcodec/options.c b/libavcodec/options.c
index eb803756fc..04fb1b404b 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -201,7 +201,6 @@ static const AVOption options[]={
{"fastint", "fast integer", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_FASTINT }, INT_MIN, INT_MAX, V|E, "dct"},
{"int", "accurate integer", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_INT }, INT_MIN, INT_MAX, V|E, "dct"},
{"mmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_MMX }, INT_MIN, INT_MAX, V|E, "dct"},
-{"mlib", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_MLIB }, INT_MIN, INT_MAX, V|E, "dct"},
{"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_ALTIVEC }, INT_MIN, INT_MAX, V|E, "dct"},
{"faan", "floating point AAN DCT", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_FAAN }, INT_MIN, INT_MAX, V|E, "dct"},
{"lumi_mask", "compresses bright areas stronger than medium ones", OFFSET(lumi_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
@@ -216,7 +215,6 @@ static const AVOption options[]={
{"simplemmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"libmpeg2mmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_LIBMPEG2MMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"ps2", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_PS2 }, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"mlib", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_MLIB }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"arm", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_ARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_ALTIVEC }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"sh4", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SH4 }, INT_MIN, INT_MAX, V|E|D, "idct"},