From 274db98899b16c07e70af7924a1b6933e765126f Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 21 Feb 2003 20:35:18 +0000 Subject: yuv2rgb brightness/contrast/saturation/different colorspaces support finished yuv2rgb deglobalize yuv2rgb optimizations / cleanup bugs? git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9477 b3059339-0415-0410-9bf9-f77b7e298cf2 --- postproc/swscale.h | 104 ++++++----------------------------------------------- 1 file changed, 10 insertions(+), 94 deletions(-) (limited to 'postproc/swscale.h') diff --git a/postproc/swscale.h b/postproc/swscale.h index fd1539b1e6..0471d6a998 100644 --- a/postproc/swscale.h +++ b/postproc/swscale.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2001-2002 Michael Niedermayer + Copyright (C) 2001-2003 Michael Niedermayer This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,6 +16,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifndef SWSCALE_H +#define SWSCALE_H + +#include "swscale_internal.h" //FIXME HACK REMOVE + /* values for the flags, the stuff on the command line is different */ #define SWS_FAST_BILINEAR 1 #define SWS_BILINEAR 2 @@ -44,8 +49,6 @@ #define SWS_FULL_CHR_H_INP 0x4000 #define SWS_DIRECT_BGR 0x8000 -#define MAX_FILTER_SIZE 256 - #define SWS_MAX_REDUCE_CUTOFF 0.002 #define SWS_CS_ITU709 1 @@ -56,97 +59,6 @@ #define SWS_CS_SMPTE240M 7 #define SWS_CS_DEFAULT 5 -/* this struct should be aligned on at least 32-byte boundary */ -typedef struct SwsContext{ - int srcW, srcH, dstH; - int chrSrcW, chrSrcH, chrDstW, chrDstH; - int lumXInc, chrXInc; - int lumYInc, chrYInc; - int dstFormat, srcFormat; - int chrSrcHSubSample, chrSrcVSubSample; - int chrIntHSubSample, chrIntVSubSample; - int chrDstHSubSample, chrDstVSubSample; - int vChrDrop; - - int16_t **lumPixBuf; - int16_t **chrPixBuf; - int16_t *hLumFilter; - int16_t *hLumFilterPos; - int16_t *hChrFilter; - int16_t *hChrFilterPos; - int16_t *vLumFilter; - int16_t *vLumFilterPos; - int16_t *vChrFilter; - int16_t *vChrFilterPos; - - uint8_t formatConvBuffer[4000]; //FIXME dynamic alloc, but we have to change alot of code for this to be usefull - - int hLumFilterSize; - int hChrFilterSize; - int vLumFilterSize; - int vChrFilterSize; - int vLumBufSize; - int vChrBufSize; - - uint8_t __attribute__((aligned(32))) funnyYCode[10000]; - uint8_t __attribute__((aligned(32))) funnyUVCode[10000]; - int32_t *lumMmx2FilterPos; - int32_t *chrMmx2FilterPos; - int16_t *lumMmx2Filter; - int16_t *chrMmx2Filter; - - int canMMX2BeUsed; - - int lastInLumBuf; - int lastInChrBuf; - int lumBufIndex; - int chrBufIndex; - int dstY; - int flags; - void * yuvTable; - void * table_rV[256]; - void * table_gU[256]; - int table_gV[256]; - void * table_bU[256]; - - 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" -#define DSTW_OFFSET "11*8+4*4*256*2" -#define ESP_OFFSET "11*8+4*4*256*2+4" - - 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]; - int dstW; - int esp; -} SwsContext; -//FIXME check init (where 0) -//FIXME split private & public // when used for filters they must have an odd number of elements @@ -185,6 +97,9 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, SwsFilter *srcFilter, SwsFilter *dstFilter); void swsGetFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam); +int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation); +int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation); + SwsVector *getGaussianVec(double variance, double quality); SwsVector *getConstVec(double c, int length); SwsVector *getIdentityVec(void); @@ -199,3 +114,4 @@ SwsVector *cloneVec(SwsVector *a); void printVec(SwsVector *a); void freeVec(SwsVector *a); +#endif -- cgit v1.2.3