Commit 880e2aa2 authored by Diego Biurrun's avatar Diego Biurrun

Remove all Blackfin architecture optimizations

Blackfin is a painful platform to work with, no test machines are available
and the range of multimedia applications is dubious. Thus it only represents
a maintenance burden.
parent b88cc5cc
OBJS-$(CONFIG_DSPUTIL) += bfin/dsputil_init.o \
bfin/dsputil.o \
bfin/fdct_bfin.o \
bfin/idct_bfin.o \
bfin/pixels.o
OBJS-$(CONFIG_HPELDSP) += bfin/hpeldsp_init.o \
bfin/hpel_pixels_no_rnd.o \
bfin/pixels.o
OBJS-$(CONFIG_VP3DSP) += bfin/vp3dsp_init.o \
bfin/vp3dsp.o
This diff is collapsed.
/*
* BlackFin DSPUTILS
*
* Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
* Copyright (c) 2006 Michael Benjamin <michael.benjamin@analog.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 <stdint.h>
#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/bfin/attributes.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
#include "libavcodec/mpegvideo.h"
void ff_bfin_idct(int16_t *block) attribute_l1_text;
void ff_bfin_fdct(int16_t *block) attribute_l1_text;
void ff_bfin_add_pixels_clamped(const int16_t *block, uint8_t *dest,
int line_size) attribute_l1_text;
void ff_bfin_put_pixels_clamped(const int16_t *block, uint8_t *dest,
int line_size) attribute_l1_text;
void ff_bfin_diff_pixels(int16_t *block, const uint8_t *s1, const uint8_t *s2,
int stride) attribute_l1_text;
void ff_bfin_get_pixels(int16_t *restrict block, const uint8_t *pixels,
int line_size) attribute_l1_text;
int ff_bfin_pix_norm1(uint8_t *pix, int line_size) attribute_l1_text;
int ff_bfin_pix_sum(uint8_t *p, int stride) attribute_l1_text;
int ff_bfin_z_sad8x8(uint8_t *blk1, uint8_t *blk2, int dsz,
int line_size, int h) attribute_l1_text;
int ff_bfin_z_sad16x16(uint8_t *blk1, uint8_t *blk2, int dsz,
int line_size, int h) attribute_l1_text;
int ff_bfin_sse4(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
int line_size, int h) attribute_l1_text;
int ff_bfin_sse8(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
int line_size, int h) attribute_l1_text;
int ff_bfin_sse16(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2,
int line_size, int h) attribute_l1_text;
static void bfin_idct_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_bfin_idct(block);
ff_bfin_add_pixels_clamped(block, dest, line_size);
}
static void bfin_idct_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_bfin_idct(block);
ff_bfin_put_pixels_clamped(block, dest, line_size);
}
static void bfin_clear_blocks(int16_t *blocks)
{
// This is just a simple memset.
__asm__ ("P0=192; "
"I0=%0; "
"R0=0; "
"LSETUP(clear_blocks_blkfn_lab,clear_blocks_blkfn_lab)LC0=P0;"
"clear_blocks_blkfn_lab:"
"[I0++]=R0;"
::"a" (blocks) : "P0", "I0", "R0");
}
static int bfin_pix_abs16(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
int line_size, int h)
{
return ff_bfin_z_sad16x16(blk1, blk2, line_size, line_size, h);
}
static uint8_t vtmp_blk[256] attribute_l1_data_b;
static int bfin_pix_abs16_x2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
int line_size, int h)
{
ff_bfin_put_pixels16uc(vtmp_blk, blk2, blk2 + 1, 16, line_size, h);
return ff_bfin_z_sad16x16(blk1, vtmp_blk, line_size, 16, h);
}
static int bfin_pix_abs16_y2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
int line_size, int h)
{
ff_bfin_put_pixels16uc(vtmp_blk, blk2, blk2 + line_size, 16, line_size, h);
return ff_bfin_z_sad16x16(blk1, vtmp_blk, line_size, 16, h);
}
static int bfin_pix_abs16_xy2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
int line_size, int h)
{
ff_bfin_z_put_pixels16_xy2(vtmp_blk, blk2, 16, line_size, h);
return ff_bfin_z_sad16x16(blk1, vtmp_blk, line_size, 16, h);
}
static int bfin_pix_abs8(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
int line_size, int h)
{
return ff_bfin_z_sad8x8(blk1, blk2, line_size, line_size, h);
}
static int bfin_pix_abs8_x2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
int line_size, int h)
{
ff_bfin_put_pixels8uc(vtmp_blk, blk2, blk2 + 1, 8, line_size, h);
return ff_bfin_z_sad8x8(blk1, vtmp_blk, line_size, 8, h);
}
static int bfin_pix_abs8_y2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
int line_size, int h)
{
ff_bfin_put_pixels8uc(vtmp_blk, blk2, blk2 + line_size, 8, line_size, h);
return ff_bfin_z_sad8x8(blk1, vtmp_blk, line_size, 8, h);
}
static int bfin_pix_abs8_xy2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2,
int line_size, int h)
{
ff_bfin_z_put_pixels8_xy2(vtmp_blk, blk2, 8, line_size, h);
return ff_bfin_z_sad8x8(blk1, vtmp_blk, line_size, 8, h);
}
/*
* decoder optimization
* start on 2/11 100 frames of 352x240@25 compiled with no optimization -g debugging
* 9.824s ~ 2.44x off
* 6.360s ~ 1.58x off with -O2
* 5.740s ~ 1.43x off with idcts
*
* 2.64s 2/20 same sman.mp4 decode only
*/
av_cold void ff_dsputil_init_bfin(DSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
c->diff_pixels = ff_bfin_diff_pixels;
c->put_pixels_clamped = ff_bfin_put_pixels_clamped;
c->add_pixels_clamped = ff_bfin_add_pixels_clamped;
c->clear_blocks = bfin_clear_blocks;
c->pix_sum = ff_bfin_pix_sum;
c->pix_norm1 = ff_bfin_pix_norm1;
c->sad[0] = bfin_pix_abs16;
c->sad[1] = bfin_pix_abs8;
/* TODO [0] 16 [1] 8 */
c->pix_abs[0][0] = bfin_pix_abs16;
c->pix_abs[0][1] = bfin_pix_abs16_x2;
c->pix_abs[0][2] = bfin_pix_abs16_y2;
c->pix_abs[0][3] = bfin_pix_abs16_xy2;
c->pix_abs[1][0] = bfin_pix_abs8;
c->pix_abs[1][1] = bfin_pix_abs8_x2;
c->pix_abs[1][2] = bfin_pix_abs8_y2;
c->pix_abs[1][3] = bfin_pix_abs8_xy2;
c->sse[0] = ff_bfin_sse16;
c->sse[1] = ff_bfin_sse8;
c->sse[2] = ff_bfin_sse4;
if (!high_bit_depth) {
c->get_pixels = ff_bfin_get_pixels;
if (avctx->dct_algo == FF_DCT_AUTO)
c->fdct = ff_bfin_fdct;
if (avctx->idct_algo == FF_IDCT_AUTO) {
c->idct_permutation_type = FF_NO_IDCT_PERM;
c->idct = ff_bfin_idct;
c->idct_add = bfin_idct_add;
c->idct_put = bfin_idct_put;
}
}
}
This diff is collapsed.
/*
* Blackfin Pixel Operations
* Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.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/bfin/asm.h"
DEFUN(put_pixels8uc_no_rnd,mL1,
(uint8_t *block, const uint8_t *s0, const uint8_t *s1,
int line_size, int h)):
i3=r0; // dest
i0=r1; // src0
i1=r2; // src1
r2=[sp+12]; // line_size
p0=[sp+16]; // h
[--sp] = (r7:6);
r2+=-4;
m3=r2;
r2+=-4;
m0=r2;
LSETUP(pp8$2,pp8$3) LC0=P0;
DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
pp8$2: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++M0]|| R2 =[I1++M0];
R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++] || [I3++] = R6 ;
pp8$3: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
(r7:6) = [sp++];
RTS;
DEFUN_END(put_pixels8uc_no_rnd)
DEFUN(put_pixels16uc_no_rnd,mL1,
(uint8_t *block, const uint8_t *s0, const uint8_t *s1,
int line_size, int h)):
i3=r0; // dest
i0=r1; // src0
i1=r2; // src1
r2=[sp+12]; // line_size
p0=[sp+16]; // h
[--sp] = (r7:6);
r2+=-12;
m3=r2; // line_size
r2+=-4;
m0=r2;
LSETUP(pp16$2,pp16$3) LC0=P0;
DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
pp16$2:
DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++] || R2 =[I1++];
R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R1 = [I0++] || R3 =[I1++];
[I3++] = R6;
R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++M0] || R2 =[I1++M0];
R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++] || [I3++] = R7 ;
[I3++] = R6;
pp16$3: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
(r7:6) = [sp++];
RTS;
DEFUN_END(put_pixels16uc_no_rnd)
/*
* BlackFin halfpel functions
*
* Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
* Copyright (c) 2006 Michael Benjamin <michael.benjamin@analog.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 <stddef.h>
#include <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/bfin/attributes.h"
#include "libavcodec/hpeldsp.h"
#include "pixels.h"
void ff_bfin_put_pixels8uc_no_rnd(uint8_t *block, const uint8_t *s0,
const uint8_t *s1, int line_size,
int h) attribute_l1_text;
void ff_bfin_put_pixels16uc_no_rnd(uint8_t *block, const uint8_t *s0,
const uint8_t *s1, int line_size,
int h) attribute_l1_text;
static void bfin_put_pixels8(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels8uc(block, pixels, pixels, line_size, line_size, h);
}
static void bfin_put_pixels8_x2(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels8uc(block, pixels, pixels + 1, line_size, line_size, h);
}
static void bfin_put_pixels8_y2(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels8uc(block, pixels, pixels + line_size,
line_size, line_size, h);
}
static void bfin_put_pixels8_xy2(uint8_t *block, const uint8_t *s0,
ptrdiff_t line_size, int h)
{
ff_bfin_z_put_pixels8_xy2(block, s0, line_size, line_size, h);
}
static void bfin_put_pixels16(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels16uc(block, pixels, pixels, line_size, line_size, h);
}
static void bfin_put_pixels16_x2(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels16uc(block, pixels, pixels + 1, line_size, line_size, h);
}
static void bfin_put_pixels16_y2(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels16uc(block, pixels, pixels + line_size,
line_size, line_size, h);
}
static void bfin_put_pixels16_xy2(uint8_t *block, const uint8_t *s0,
ptrdiff_t line_size, int h)
{
ff_bfin_z_put_pixels16_xy2(block, s0, line_size, line_size, h);
}
static void bfin_put_pixels8_no_rnd(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels8uc_no_rnd(block, pixels, pixels, line_size, h);
}
static void bfin_put_pixels8_x2_no_rnd(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels8uc_no_rnd(block, pixels, pixels + 1, line_size, h);
}
static void bfin_put_pixels8_y2_no_rnd(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels8uc_no_rnd(block, pixels, pixels + line_size,
line_size, h);
}
static void bfin_put_pixels16_no_rnd(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels16uc_no_rnd(block, pixels, pixels, line_size, h);
}
static void bfin_put_pixels16_x2_no_rnd(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels16uc_no_rnd(block, pixels, pixels + 1, line_size, h);
}
static void bfin_put_pixels16_y2_no_rnd(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
ff_bfin_put_pixels16uc_no_rnd(block, pixels, pixels + line_size,
line_size, h);
}
av_cold void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags)
{
c->put_pixels_tab[0][0] = bfin_put_pixels16;
c->put_pixels_tab[0][1] = bfin_put_pixels16_x2;
c->put_pixels_tab[0][2] = bfin_put_pixels16_y2;
c->put_pixels_tab[0][3] = bfin_put_pixels16_xy2;
c->put_pixels_tab[1][0] = bfin_put_pixels8;
c->put_pixels_tab[1][1] = bfin_put_pixels8_x2;
c->put_pixels_tab[1][2] = bfin_put_pixels8_y2;
c->put_pixels_tab[1][3] = bfin_put_pixels8_xy2;
c->put_no_rnd_pixels_tab[1][0] = bfin_put_pixels8_no_rnd;
c->put_no_rnd_pixels_tab[1][1] = bfin_put_pixels8_x2_no_rnd;
c->put_no_rnd_pixels_tab[1][2] = bfin_put_pixels8_y2_no_rnd;
c->put_no_rnd_pixels_tab[0][0] = bfin_put_pixels16_no_rnd;
c->put_no_rnd_pixels_tab[0][1] = bfin_put_pixels16_x2_no_rnd;
c->put_no_rnd_pixels_tab[0][2] = bfin_put_pixels16_y2_no_rnd;
}
This diff is collapsed.
/*
* simple math operations
*
* Copyright (C) 2007 Marc Hoffman <mmhoffm@gmail.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_BFIN_MATHOPS_H
#define AVCODEC_BFIN_MATHOPS_H
#include "config.h"
#define MULH(X,Y) ({ int xxo; \
__asm__ ( \
"a1 = %2.L * %1.L (FU);\n\t" \
"a1 = a1 >> 16;\n\t" \
"a1 += %2.H * %1.L (IS,M);\n\t" \
"a0 = %1.H * %2.H, a1+= %1.H * %2.L (IS,M);\n\t"\
"a1 = a1 >>> 16;\n\t" \
"%0 = (a0 += a1);\n\t" \
: "=d" (xxo) : "d" (X), "d" (Y) : "A0","A1"); xxo; })
/* signed 16x16 -> 32 multiply */
#define MUL16(a, b) ({ int xxo; \
__asm__ ( \
"%0 = %1.l*%2.l (is);\n\t" \
: "=W" (xxo) : "d" (a), "d" (b) : "A1"); \
xxo; })
#endif /* AVCODEC_BFIN_MATHOPS_H */
/*
* Blackfin Pixel Operations
* Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.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/bfin/asm.h"
/*
motion compensation
primitives
* Halfpel motion compensation with rounding (a+b+1)>>1.
* This is an array[4][4] of motion compensation funcions for 4
* horizontal blocksizes (8,16) and the 4 halfpel positions<br>
* *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
* @param block destination where the result is stored
* @param pixels source
* @param line_size number of bytes in a horizontal line of block
* @param h height
*/
DEFUN(put_pixels8uc,mL1,
(uint8_t *block, const uint8_t *s0, const uint8_t *s1,
int dest_size, int line_size, int h)):
i3=r0; // dest
i0=r1; // src0
i1=r2; // src1
r0=[sp+12]; // dest_size
r2=[sp+16]; // line_size
p0=[sp+20]; // h
[--sp] = (r7:6);
r0+=-4;
m3=r0;
r2+=-8;
m0=r2;
LSETUP(pp8$0,pp8$1) LC0=P0;
DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
pp8$0: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
R6 = BYTEOP1P(R1:0,R3:2) || R0 = [I0++M0]|| R2 =[I1++M0];
R7 = BYTEOP1P(R1:0,R3:2)(R) || R0 = [I0++] || [I3++] = R6 ;
pp8$1: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
(r7:6) = [sp++];
RTS;
DEFUN_END(put_pixels8uc)
DEFUN(put_pixels16uc,mL1,
(uint8_t *block, const uint8_t *s0, const uint8_t *s1,
int dest_size, int line_size, int h)):
link 0;
[--sp] = (r7:6);
i3=r0; // dest
i0=r1; // src0
i1=r2; // src1
r0=[fp+20]; // dest_size
r2=[fp+24]; // line_size
p0=[fp+28]; // h
r0+=-12;
m3=r0; // line_size
r2+=-16;
m0=r2;
LSETUP(pp16$0,pp16$1) LC0=P0;
DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
pp16$0: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
R6 = BYTEOP1P(R1:0,R3:2) || R0 = [I0++] || R2 =[I1++];
R7 = BYTEOP1P(R1:0,R3:2)(R) || R1 = [I0++] || R3 =[I1++];
[I3++] = R6;
R6 = BYTEOP1P(R1:0,R3:2) || R0 = [I0++M0] || R2 =[I1++M0];
R7 = BYTEOP1P(R1:0,R3:2)(R) || R0 = [I0++] || [I3++] = R7 ;
[I3++] = R6;
pp16$1: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
(r7:6) = [sp++];
unlink;
RTS;
DEFUN_END(put_pixels16uc)
DEFUN(z_put_pixels16_xy2,mL1,
(uint8_t *block, const uint8_t *s0,
int dest_size, int line_size, int h)):
link 0;
[--sp] = (r7:4);
i3=r0; // dest
i0=r1; // src0--> pixels
i1=r1; // src1--> pixels + line_size
r2+=-12;
m2=r2; // m2=dest_width-4
r2=[fp+20];
m3=r2; // line_size
p0=[fp+24]; // h
r2+=-16;
i1+=m3; /* src1 + line_size */
m0=r2; /* line-size - 20 */
B0 = I0;
B1 = I1;
B3 = I3;
DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
LSETUP(LS$16E,LE$16E) LC0=P0;
LS$16E: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
R4 = BYTEOP2P (R3:2,R1:0) (RNDL) || R0 = [I0++] || R2 =[I1++];
R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R1 = [I0++] || [I3++] = R4 ;
DISALGNEXCPT || R3 = [I1++] || [I3++] = R5;
R4 = BYTEOP2P (R3:2,R1:0) (RNDL) || R0 = [I0++M0]|| R2 = [I1++M0];
R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R0 = [I0++] || [I3++] = R4 ;
LE$16E: DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
M1 = 1;
I3 = B3;
I1 = B1;
I0 = B0;
I0 += M1;
I1 += M1;
DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
LSETUP(LS$16O,LE$16O) LC0=P0;
LS$16O: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
R4 = BYTEOP2P (R3:2,R1:0) (RNDH) || R0 = [I0++] || R2 =[I1++];
R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R1 = [I0++] || R6 =[I3++];
R4 = R4 +|+ R6 || R7 = [I3--];
R5 = R5 +|+ R7 || [I3++] = R4;
DISALGNEXCPT || R3 =[I1++] || [I3++] = R5;
R4 = BYTEOP2P (R3:2,R1:0) (RNDH) || R0 = [I0++M0]|| R2 = [I1++M0];
R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R0 = [I0++] || R6 = [I3++];
R4 = R4 +|+ R6 || R7 = [I3--];
R5 = R5 +|+ R7 || [I3++] = R4;
LE$16O: DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
(r7:4) = [sp++];
unlink;
rts;
DEFUN_END(z_put_pixels16_xy2)
DEFUN(z_put_pixels8_xy2,mL1,
(uint8_t *block, const uint8_t *s0,
int dest_size, int line_size, int h)):
link 0;
[--sp] = (r7:4);
i3=r0; // dest
i0=r1; // src0--> pixels
i1=r1; // src1--> pixels + line_size
r2+=-4;
m2=r2; // m2=dest_width-4
r2=[fp+20];
m3=r2; // line_size
p0=[fp+24]; // h
r2+=-8;
i1+=m3; /* src1 + line_size */
m0=r2; /* line-size - 20 */
b0 = I0;
b1 = I1;
b3 = I3;
LSETUP(LS$8E,LE$8E) LC0=P0;
DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
LS$8E: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
R4 = BYTEOP2P (R3:2,R1:0) (RNDL) || R0 = [I0++M0] || R2 =[I1++M0];
R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R0 = [I0++] || [I3++] = R4 ;
LE$8E: DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
M1 = 1;
I3 = b3;
I1 = b1;
I0 = b0;
I0 += M1;
I1 += M1;
LSETUP(LS$8O,LE$8O) LC0=P0;
DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
LS$8O: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
R4 = BYTEOP2P (R3:2,R1:0) (RNDH) || R0 = [I0++M0] || R2 =[I1++M0];
R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R0 = [I0++] || R6 =[I3++];
R4 = R4 +|+ R6 || R7 = [I3--];
R5 = R5 +|+ R7 || [I3++] = R4;
LE$8O: DISALGNEXCPT || R2 =[I1++] || [I3++M2] = R5;
(r7:4) = [sp++];
unlink;
rts;
DEFUN_END(z_put_pixels8_xy2)
/*
* Copyright (C) 2007 Marc Hoffman <mmh@pleasantst.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_BFIN_PIXELS_H
#define AVCODEC_BFIN_PIXELS_H
#include <stdint.h>
#include "libavutil/bfin/attributes.h"
void ff_bfin_z_put_pixels16_xy2(uint8_t *block, const uint8_t *s0,
int dest_size, int line_size, int h) attribute_l1_text;
void ff_bfin_z_put_pixels8_xy2(uint8_t *block, const uint8_t *s0,
int dest_size, int line_size, int h) attribute_l1_text;
void ff_bfin_put_pixels8uc(uint8_t *block, const uint8_t *s0,
const uint8_t *s1, int dest_size, int line_size,
int h) attribute_l1_text;
void ff_bfin_put_pixels16uc(uint8_t *block, const uint8_t *s0,
const uint8_t *s1, int dest_size, int line_size,
int h) attribute_l1_text;
#endif /* AVCODEC_BFIN_PIXELS_H */
This diff is collapsed.
/*
* Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.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 <stdint.h>
#include <string.h>
#include "libavutil/attributes.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/mathops.h"
#include "libavcodec/vp3dsp.h"
void ff_bfin_vp3_idct(int16_t *block);
/* Intra iDCT offset 128 */
static void bfin_vp3_idct_put(uint8_t *dest, int line_size, int16_t *block)
{
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP + 128;
int i,j;
ff_bfin_vp3_idct (block);
for (i=0;i<8;i++)
for (j=0;j<8;j++)
dest[line_size*i + j] = cm[block[j*8 + i]];
memset(block, 0, 128);
}
/* Inter iDCT */
static void bfin_vp3_idct_add(uint8_t *dest, int line_size, int16_t *block)
{
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
int i, j;
ff_bfin_vp3_idct (block);
for (i = 0; i < 8; i++)
for (j = 0; j < 8; j++)
dest[line_size*i + j] = cm[dest[line_size*i + j] + block[j*8 + i]];
memset(block, 0, 128);
}
av_cold void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags)
{
if (!(flags & CODEC_FLAG_BITEXACT)) {
c->idct_add = bfin_vp3_idct_add;
c->idct_put = bfin_vp3_idct_put;
}
}
......@@ -47,10 +47,6 @@
#include "x86/idct_xvid.h"
#include "dctref.h"
// BFIN
void ff_bfin_idct(int16_t *block);
void ff_bfin_fdct(int16_t *block);
// ALTIVEC
void ff_fdct_altivec(int16_t *block);
......@@ -92,10 +88,6 @@ static const struct algo fdct_tab[] = {
{ "altivecfdct", ff_fdct_altivec, NO_PERM, AV_CPU_FLAG_ALTIVEC },
#endif
#if ARCH_BFIN
{ "BFINfdct", ff_bfin_fdct, NO_PERM },
#endif
{ 0 }
};
......@@ -116,10 +108,6 @@ static const struct algo idct_tab[] = {
{ "XVID-SSE2", ff_idct_xvid_sse2, SSE2_PERM, AV_CPU_FLAG_SSE2, 1 },
#endif
#if ARCH_BFIN
{ "BFINidct", ff_bfin_idct, NO_PERM },
#endif
#if ARCH_ARM
{ "SIMPLE-ARM", ff_simple_idct_arm, NO_PERM },
{ "INT-ARM", ff_j_rev_dct_arm, MMX_PERM },
......
......@@ -1561,8 +1561,6 @@ av_cold void ff_dsputil_init(DSPContext *c, AVCodecContext *avctx)
if (ARCH_ARM)
ff_dsputil_init_arm(c, avctx, high_bit_depth);
if (ARCH_BFIN)
ff_dsputil_init_bfin(c, avctx, high_bit_depth);
if (ARCH_PPC)
ff_dsputil_init_ppc(c, avctx, high_bit_depth);
if (ARCH_X86)
......
......@@ -245,8 +245,6 @@ void ff_set_cmp(DSPContext *c, me_cmp_func *cmp, int type);
void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_dsputil_init_bfin(DSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth);
void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx,
......
......@@ -359,8 +359,6 @@ av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
ff_hpeldsp_init_aarch64(c, flags);
if (ARCH_ARM)
ff_hpeldsp_init_arm(c, flags);
if (ARCH_BFIN)
ff_hpeldsp_init_bfin(c, flags);
if (ARCH_PPC)
ff_hpeldsp_init_ppc(c, flags);
if (ARCH_X86)
......
......@@ -96,7 +96,6 @@ void ff_hpeldsp_init(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_aarch64(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags);
......
......@@ -290,8 +290,6 @@ av_cold void ff_vp3dsp_init(VP3DSPContext *c, int flags)
if (ARCH_ARM)
ff_vp3dsp_init_arm(c, flags);
if (ARCH_BFIN)
ff_vp3dsp_init_bfin(c, flags);
if (ARCH_PPC)
ff_vp3dsp_init_ppc(c, flags);
if (ARCH_X86)
......
......@@ -47,7 +47,6 @@ typedef struct VP3DSPContext {
void ff_vp3dsp_init(VP3DSPContext *c, int flags);
void ff_vp3dsp_init_arm(VP3DSPContext *c, int flags);
void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags);
void ff_vp3dsp_init_ppc(VP3DSPContext *c, int flags);
void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags);
......
/*
* Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.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 AVUTIL_BFIN_ASM_H
#define AVUTIL_BFIN_ASM_H
#include "config.h"
#define mL3 .text
#if defined(__FDPIC__) && CONFIG_SRAM
#define mL1 .l1.text
#define SECTION_L1_DATA_A .section .l1.data.A,"aw",@progbits
#define SECTION_L1_DATA_B .section .l1.data.B,"aw",@progbits
#else
#define mL1 mL3
#define SECTION_L1_DATA_A
#define SECTION_L1_DATA_B .data
#endif
#define DEFUN(fname, where, interface) \
.section where; \
.global _ff_bfin_ ## fname; \
.type _ff_bfin_ ## fname, STT_FUNC; \
.align 8; \
_ff_bfin_ ## fname
#define DEFUN_END(fname) \
.size _ff_bfin_ ## fname, . - _ff_bfin_ ## fname
#ifdef __FDPIC__
#define RELOC(reg, got, obj) reg = [got + obj@GOT17M4]
#else
#define RELOC(reg, got, obj) reg.L = obj; reg.H = obj
#endif
#endif /* AVUTIL_BFIN_ASM_H */
/*
* Copyright (C) 2007 Marc Hoffman <mmh@pleasantst.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 AVUTIL_BFIN_ATTRIBUTES_H
#define AVUTIL_BFIN_ATTRIBUTES_H
#include "config.h"
#if defined(__FDPIC__) && CONFIG_SRAM
#define attribute_l1_text __attribute__((l1_text))
#define attribute_l1_data_b __attribute__((l1_data_B))
#else
#define attribute_l1_text
#define attribute_l1_data_b
#endif
#endif /* AVUTIL_BFIN_ATTRIBUTES_H */
OBJS += bfin/internal_bfin.o \
bfin/swscale_bfin.o \
bfin/yuv2rgb_bfin.o \
This diff is collapsed.
/*
* Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
*
* Blackfin software video scaler operations
*
* 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 "config.h"
#include "libavutil/attributes.h"
#include "libavutil/bfin/attributes.h"
#include "libswscale/swscale_internal.h"
int ff_bfin_uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
uint8_t *vdst, int width, int height,
int lumStride, int chromStride,
int srcStride) attribute_l1_text;
int ff_bfin_yuyvtoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
uint8_t *vdst, int width, int height,
int lumStride, int chromStride,
int srcStride) attribute_l1_text;
static int uyvytoyv12_unscaled(SwsContext *c, const uint8_t *src[],
int srcStride[], int srcSliceY, int srcSliceH,
uint8_t *dst[], int dstStride[])
{
uint8_t *dsty = dst[0] + dstStride[0] * srcSliceY;
uint8_t *dstu = dst[1] + dstStride[1] * srcSliceY / 2;
uint8_t *dstv = dst[2] + dstStride[2] * srcSliceY / 2;
const uint8_t *ip = src[0] + srcStride[0] * srcSliceY;
int w = dstStride[0];
ff_bfin_uyvytoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
dstStride[0], dstStride[1], srcStride[0]);
return srcSliceH;
}
static int yuyvtoyv12_unscaled(SwsContext *c, const uint8_t *src[],
int srcStride[], int srcSliceY, int srcSliceH,
uint8_t *dst[], int dstStride[])
{
uint8_t *dsty = dst[0] + dstStride[0] * srcSliceY;
uint8_t *dstu = dst[1] + dstStride[1] * srcSliceY / 2;
uint8_t *dstv = dst[2] + dstStride[2] * srcSliceY / 2;
const uint8_t *ip = src[0] + srcStride[0] * srcSliceY;
int w = dstStride[0];
ff_bfin_yuyvtoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
dstStride[0], dstStride[1], srcStride[0]);
return srcSliceH;
}
av_cold void ff_get_unscaled_swscale_bfin(SwsContext *c)
{
if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_UYVY422) {
av_log(NULL, AV_LOG_VERBOSE,
"selecting Blackfin optimized uyvytoyv12_unscaled\n");
c->swscale = uyvytoyv12_unscaled;
}
if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_YUYV422) {
av_log(NULL, AV_LOG_VERBOSE,
"selecting Blackfin optimized yuyvtoyv12_unscaled\n");
c->swscale = yuyvtoyv12_unscaled;
}
}
/*
* Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
*
* Blackfin video color space converter operations
* convert I420 YV12 to RGB in various formats
*
* 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 "config.h"
#include "libavutil/attributes.h"
#include "libavutil/bfin/attributes.h"
#include "libswscale/swscale_internal.h"
void ff_bfin_yuv2rgb555_line(const uint8_t *Y, const uint8_t *U,
const uint8_t *V, uint8_t *out,
int w, uint32_t *coeffs) attribute_l1_text;
void ff_bfin_yuv2rgb565_line(const uint8_t *Y, const uint8_t *U,
const uint8_t *V, uint8_t *out,
int w, uint32_t *coeffs) attribute_l1_text;
void ff_bfin_yuv2rgb24_line(const uint8_t *Y, const uint8_t *U,
const uint8_t *V, uint8_t *out,
int w, uint32_t *coeffs) attribute_l1_text;
typedef void (*ltransform)(const uint8_t *Y, const uint8_t *U, const uint8_t *V,
uint8_t *out, int w, uint32_t *coeffs);
static void bfin_prepare_coefficients(SwsContext *c, int rgb, int masks)
{
int oy;
oy = c->yOffset & 0xffff;
oy = oy >> 3; // keep everything U8.0 for offset calculation
c->oc = 128 * 0x01010101U;
c->oy = oy * 0x01010101U;
/* copy 64bit vector coeffs down to 32bit vector coeffs */
c->cy = c->yCoeff;
c->zero = 0;
if (rgb) {
c->crv = c->vrCoeff;
c->cbu = c->ubCoeff;
c->cgu = c->ugCoeff;
c->cgv = c->vgCoeff;
} else {
c->crv = c->ubCoeff;
c->cbu = c->vrCoeff;
c->cgu = c->vgCoeff;
c->cgv = c->ugCoeff;
}
if (masks == 555) {
c->rmask = 0x001f * 0x00010001U;
c->gmask = 0x03e0 * 0x00010001U;
c->bmask = 0x7c00 * 0x00010001U;
} else if (masks == 565) {
c->rmask = 0x001f * 0x00010001U;
c->gmask = 0x07e0 * 0x00010001U;
c->bmask = 0xf800 * 0x00010001U;
}
}
static int core_yuv420_rgb(SwsContext *c, const uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH, uint8_t **oplanes,
int *outstrides, ltransform lcscf,
int rgb, int masks)
{
const uint8_t *py, *pu, *pv;
uint8_t *op;
int w = instrides[0];
int h2 = srcSliceH >> 1;
int i;
bfin_prepare_coefficients(c, rgb, masks);
py = in[0];
pu = in[1 + (1 ^ rgb)];
pv = in[1 + (0 ^ rgb)];
op = oplanes[0] + srcSliceY * outstrides[0];
for (i = 0; i < h2; i++) {
lcscf(py, pu, pv, op, w, &c->oy);
py += instrides[0];
op += outstrides[0];
lcscf(py, pu, pv, op, w, &c->oy);
py += instrides[0];
pu += instrides[1];
pv += instrides[2];
op += outstrides[0];
}
return srcSliceH;
}
static int bfin_yuv420_rgb555(SwsContext *c, const uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb555_line, 1, 555);
}
static int bfin_yuv420_bgr555(SwsContext *c, const uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb555_line, 0, 555);
}
static int bfin_yuv420_rgb24(SwsContext *c, const uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb24_line, 1, 888);
}
static int bfin_yuv420_bgr24(SwsContext *c, const uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb24_line, 0, 888);
}
static int bfin_yuv420_rgb565(SwsContext *c, const uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb565_line, 1, 565);
}
static int bfin_yuv420_bgr565(SwsContext *c, const uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb565_line, 0, 565);
}
av_cold SwsFunc ff_yuv2rgb_init_bfin(SwsContext *c)
{
SwsFunc f;
switch (c->dstFormat) {
case AV_PIX_FMT_RGB555:
f = bfin_yuv420_rgb555;
break;
case AV_PIX_FMT_BGR555:
f = bfin_yuv420_bgr555;
break;
case AV_PIX_FMT_RGB565:
f = bfin_yuv420_rgb565;
break;
case AV_PIX_FMT_BGR565:
f = bfin_yuv420_bgr565;
break;
case AV_PIX_FMT_RGB24:
f = bfin_yuv420_rgb24;
break;
case AV_PIX_FMT_BGR24:
f = bfin_yuv420_bgr24;
break;
default:
return 0;
}
av_log(c, AV_LOG_INFO, "BlackFin accelerated color space converter %s\n",
sws_format_name(c->dstFormat));
return f;
}
......@@ -92,7 +92,9 @@ const char *swscale_license(void);
#define SWS_CPU_CAPS_MMX2 0x20000000
#define SWS_CPU_CAPS_3DNOW 0x40000000
#define SWS_CPU_CAPS_ALTIVEC 0x10000000
#if FF_API_ARCH_BFIN
#define SWS_CPU_CAPS_BFIN 0x01000000
#endif
#define SWS_CPU_CAPS_SSE2 0x02000000
#endif
......
......@@ -436,20 +436,6 @@ typedef struct SwsContext {
vector signed short *vYCoeffsBank, *vCCoeffsBank;
#endif
#if ARCH_BFIN
DECLARE_ALIGNED(4, uint32_t, oy);
DECLARE_ALIGNED(4, uint32_t, oc);
DECLARE_ALIGNED(4, uint32_t, zero);
DECLARE_ALIGNED(4, uint32_t, cy);
DECLARE_ALIGNED(4, uint32_t, crv);
DECLARE_ALIGNED(4, uint32_t, rmask);
DECLARE_ALIGNED(4, uint32_t, cbu);
DECLARE_ALIGNED(4, uint32_t, bmask);
DECLARE_ALIGNED(4, uint32_t, cgu);
DECLARE_ALIGNED(4, uint32_t, cgv);
DECLARE_ALIGNED(4, uint32_t, gmask);
#endif
/* function pointers for swscale() */
yuv2planar1_fn yuv2plane1;
yuv2planarX_fn yuv2planeX;
......@@ -568,7 +554,6 @@ void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufI
SwsFunc ff_yuv2rgb_init_x86(SwsContext *c);
SwsFunc ff_yuv2rgb_init_ppc(SwsContext *c);
SwsFunc ff_yuv2rgb_init_bfin(SwsContext *c);
const char *sws_format_name(enum AVPixelFormat format);
......@@ -733,7 +718,6 @@ extern const AVClass sws_context_class;
* source and destination formats, bit depths, flags, etc.
*/
void ff_get_unscaled_swscale(SwsContext *c);
void ff_get_unscaled_swscale_bfin(SwsContext *c);
void ff_get_unscaled_swscale_ppc(SwsContext *c);
/**
......
......@@ -1117,8 +1117,6 @@ void ff_get_unscaled_swscale(SwsContext *c)
c->swscale = planarCopyWrapper;
}
if (ARCH_BFIN)
ff_get_unscaled_swscale_bfin(c);
if (ARCH_PPC)
ff_get_unscaled_swscale_ppc(c);
}
......
......@@ -52,5 +52,8 @@
#ifndef FF_API_SWS_CPU_CAPS
#define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 3)
#endif
#ifndef FF_API_ARCH_BFIN
#define FF_API_ARCH_BFIN (LIBSWSCALE_VERSION_MAJOR < 3)
#endif
#endif /* SWSCALE_VERSION_H */
......@@ -560,8 +560,6 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
{
SwsFunc t = NULL;
if (ARCH_BFIN)
t = ff_yuv2rgb_init_bfin(c);
if (ARCH_PPC)
t = ff_yuv2rgb_init_ppc(c);
if (ARCH_X86)
......
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