Commit 77a49659 authored by Michael Niedermayer's avatar Michael Niedermayer

cleanup

Originally committed as revision 9414 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
parent d271b84b
......@@ -2019,6 +2019,15 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
c->dstFormat= dstFormat;
c->srcFormat= srcFormat;
c->yCoeff= 0x2568256825682568LL;
c->vrCoeff= 0x3343334333433343LL;
c->ubCoeff= 0x40cf40cf40cf40cfLL;
c->vgCoeff= 0xE5E2E5E2E5E2E5E2LL;
c->ugCoeff= 0xF36EF36EF36EF36ELL;
c->yOffset= 0x0080008000800080LL;
c->uOffset= 0x0400040004000400LL;
c->vOffset= 0x0400040004000400LL;
usesFilter=0;
if(dstFilter->lumV!=NULL && dstFilter->lumV->length>1) usesFilter=1;
if(dstFilter->lumH!=NULL && dstFilter->lumH->length>1) usesFilter=1;
......@@ -2261,19 +2270,6 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
ASSERT(c->chrDstH <= dstH)
// pack filter data for mmx code
if(cpuCaps.hasMMX)
{
c->lumMmxFilter= (int16_t*)memalign(8, c->vLumFilterSize* dstH*4*sizeof(int16_t));
c->chrMmxFilter= (int16_t*)memalign(8, c->vChrFilterSize*c->chrDstH*4*sizeof(int16_t));
for(i=0; i<c->vLumFilterSize*dstH; i++)
c->lumMmxFilter[4*i]=c->lumMmxFilter[4*i+1]=c->lumMmxFilter[4*i+2]=c->lumMmxFilter[4*i+3]=
c->vLumFilter[i];
for(i=0; i<c->vChrFilterSize*c->chrDstH; i++)
c->chrMmxFilter[4*i]=c->chrMmxFilter[4*i+1]=c->chrMmxFilter[4*i+2]=c->chrMmxFilter[4*i+3]=
c->vChrFilter[i];
}
if(flags&SWS_PRINT_INFO)
{
#ifdef DITHER1XBPP
......@@ -2668,11 +2664,6 @@ void freeSwsContext(SwsContext *c){
if(c->hChrFilterPos) free(c->hChrFilterPos);
c->hChrFilterPos = NULL;
if(c->lumMmxFilter) free(c->lumMmxFilter);
c->lumMmxFilter = NULL;
if(c->chrMmxFilter) free(c->chrMmxFilter);
c->chrMmxFilter = NULL;
if(c->lumMmx2Filter) free(c->lumMmx2Filter);
c->lumMmx2Filter=NULL;
if(c->chrMmx2Filter) free(c->chrMmx2Filter);
......
......@@ -44,6 +44,7 @@
#define SWS_FULL_CHR_H_INP 0x4000
#define SWS_DIRECT_BGR 0x8000
#define MAX_FILTER_SIZE 256
#define SWS_MAX_REDUCE_CUTOFF 0.002
......@@ -70,9 +71,6 @@ typedef struct SwsContext{
int16_t *vChrFilter;
int16_t *vChrFilterPos;
// Contain simply the values from v(Lum|Chr)Filter just nicely packed for mmx
int16_t *lumMmxFilter;
int16_t *chrMmxFilter;
uint8_t formatConvBuffer[4000]; //FIXME dynamic alloc, but we have to change alot of code for this to be usefull
int hLumFilterSize;
......@@ -105,8 +103,40 @@ typedef struct SwsContext{
void (*swScale)(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]);
#define RED_DITHER "0*8"
#define GREEN_DITHER "1*8"
#define BLUE_DITHER "2*8"
#define Y_COEFF "3*8"
#define VR_COEFF "4*8"
#define UB_COEFF "5*8"
#define VG_COEFF "6*8"
#define UG_COEFF "7*8"
#define Y_OFFSET "8*8"
#define U_OFFSET "9*8"
#define V_OFFSET "10*8"
#define LUM_MMX_FILTER_OFFSET "11*8"
#define CHR_MMX_FILTER_OFFSET "11*8+4*4*256"
uint64_t redDither __attribute__((aligned(8)));
uint64_t greenDither __attribute__((aligned(8)));
uint64_t blueDither __attribute__((aligned(8)));
uint64_t yCoeff __attribute__((aligned(8)));
uint64_t vrCoeff __attribute__((aligned(8)));
uint64_t ubCoeff __attribute__((aligned(8)));
uint64_t vgCoeff __attribute__((aligned(8)));
uint64_t ugCoeff __attribute__((aligned(8)));
uint64_t yOffset __attribute__((aligned(8)));
uint64_t uOffset __attribute__((aligned(8)));
uint64_t vOffset __attribute__((aligned(8)));
int32_t lumMmxFilter[4*MAX_FILTER_SIZE];
int32_t chrMmxFilter[4*MAX_FILTER_SIZE];
} SwsContext;
//FIXME check init (where 0)
//FIXME split private & public
// when used for filters they must have an odd number of elements
// coeffs cannot be shared between vectors
......
This diff is collapsed.
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