X-Git-Url: http://git.videolan.org/?p=ffmpeg.git;a=blobdiff_plain;f=libavfilter%2Flibmpcodecs%2Fvf_pp7.c;h=05421aee050fd183125d4ee802c51cd1cbef28dd;hp=7f0e39d6ffafb1f75f5a478735975ff60c86a589;hb=80dd0aff3346d39368b88127c18dc846614c36d4;hpb=de42d2a347991a53a2814e52d21d65ddbacf7119;ds=sidebyside diff --git a/libavfilter/libmpcodecs/vf_pp7.c b/libavfilter/libmpcodecs/vf_pp7.c index 7f0e39d6ff..05421aee05 100644 --- a/libavfilter/libmpcodecs/vf_pp7.c +++ b/libavfilter/libmpcodecs/vf_pp7.c @@ -44,10 +44,8 @@ #define XMIN(a,b) ((a) < (b) ? (a) : (b)) #define XMAX(a,b) ((a) > (b) ? (a) : (b)) -typedef short DCTELEM; - //===========================================================================// -static const uint8_t __attribute__((aligned(8))) dither[8][8]={ +DECLARE_ASM_CONST(8, uint8_t, dither)[8][8]={ { 0, 48, 12, 60, 3, 51, 15, 63, }, { 32, 16, 44, 28, 35, 19, 47, 31, }, { 8, 56, 4, 52, 11, 59, 7, 55, }, @@ -66,7 +64,7 @@ struct vf_priv_s { uint8_t *src; }; #if 0 -static inline void dct7_c(DCTELEM *dst, int s0, int s1, int s2, int s3, int step){ +static inline void dct7_c(int16_t *dst, int s0, int s1, int s2, int s3, int step){ int s, d; int dst2[64]; //#define S0 (1024/0.37796447300922719759) @@ -113,7 +111,7 @@ static inline void dct7_c(DCTELEM *dst, int s0, int s1, int s2, int s3, int step } #endif -static inline void dctA_c(DCTELEM *dst, uint8_t *src, int stride){ +static inline void dctA_c(int16_t *dst, uint8_t *src, int stride){ int i; for(i=0; i<4; i++){ @@ -135,7 +133,7 @@ static inline void dctA_c(DCTELEM *dst, uint8_t *src, int stride){ } } -static void dctB_c(DCTELEM *dst, DCTELEM *src){ +static void dctB_c(int16_t *dst, int16_t *src){ int i; for(i=0; i<4; i++){ @@ -158,7 +156,7 @@ static void dctB_c(DCTELEM *dst, DCTELEM *src){ } #if HAVE_MMX -static void dctB_mmx(DCTELEM *dst, DCTELEM *src){ +static void dctB_mmx(int16_t *dst, int16_t *src){ __asm__ volatile ( "movq (%0), %%mm0 \n\t" "movq 1*4*2(%0), %%mm1 \n\t" @@ -191,7 +189,7 @@ static void dctB_mmx(DCTELEM *dst, DCTELEM *src){ } #endif -static void (*dctB)(DCTELEM *dst, DCTELEM *src)= dctB_c; +static void (*dctB)(int16_t *dst, int16_t *src)= dctB_c; #define N0 4 #define N1 5 @@ -228,7 +226,7 @@ static void init_thres2(void){ } } -static int hardthresh_c(DCTELEM *src, int qp){ +static int hardthresh_c(int16_t *src, int qp){ int i; int a; @@ -244,7 +242,7 @@ static int hardthresh_c(DCTELEM *src, int qp){ return (a + (1<<11))>>12; } -static int mediumthresh_c(DCTELEM *src, int qp){ +static int mediumthresh_c(int16_t *src, int qp){ int i; int a; @@ -265,7 +263,7 @@ static int mediumthresh_c(DCTELEM *src, int qp){ return (a + (1<<11))>>12; } -static int softthresh_c(DCTELEM *src, int qp){ +static int softthresh_c(int16_t *src, int qp){ int i; int a; @@ -282,14 +280,14 @@ static int softthresh_c(DCTELEM *src, int qp){ return (a + (1<<11))>>12; } -static int (*requantize)(DCTELEM *src, int qp)= hardthresh_c; +static int (*requantize)(int16_t *src, int qp)= hardthresh_c; static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, uint8_t *qp_store, int qp_stride, int is_luma){ int x, y; const int stride= is_luma ? p->temp_stride : ((width+16+15)&(~15)); uint8_t *p_src= p->src + 8*stride; - DCTELEM *block= (DCTELEM *)p->src; - DCTELEM *temp= (DCTELEM *)(p->src + 32); + int16_t *block= (int16_t *)p->src; + int16_t *temp= (int16_t *)(p->src + 32); if (!src || !dst) return; // HACK avoid crash for Y8 colourspace for(y=0; y