summaryrefslogtreecommitdiff
path: root/libavcodec/diracdsp.c
diff options
context:
space:
mode:
authorJordi Ortiz <nenjordi@gmail.com>2011-10-27 20:24:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-30 21:50:17 +0100
commit49aa397414eb4dbe5da292fcdb8a6084f71ae949 (patch)
treeb2ba0eb2eeb72ee2e702a060f2374d05681e4494 /libavcodec/diracdsp.c
parentca239e1c372f8962f5ff93c80afa7b98e09bf3a3 (diff)
Dirac: More formating
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/diracdsp.c')
-rw-r--r--libavcodec/diracdsp.c138
1 files changed, 69 insertions, 69 deletions
diff --git a/libavcodec/diracdsp.c b/libavcodec/diracdsp.c
index 4c3cddbdfc..5c1c7068de 100644
--- a/libavcodec/diracdsp.c
+++ b/libavcodec/diracdsp.c
@@ -20,13 +20,13 @@
#include "dsputil.h"
#include "diracdsp.h"
-//MMX_DISABLE #include "libavcodec/x86/diracdsp_mmx.h"
+/* MMX_DISABLE #include "libavcodec/x86/diracdsp_mmx.h" */
-#define FILTER(src, stride) \
- ((21*((src)[ 0*stride] + (src)[1*stride]) \
- -7*((src)[-1*stride] + (src)[2*stride]) \
- +3*((src)[-2*stride] + (src)[3*stride]) \
- -1*((src)[-3*stride] + (src)[4*stride]) + 16) >> 5)
+#define FILTER(src, stride) \
+ ((21*((src)[ 0*stride] + (src)[1*stride]) \
+ -7*((src)[-1*stride] + (src)[2*stride]) \
+ +3*((src)[-2*stride] + (src)[3*stride]) \
+ -1*((src)[-3*stride] + (src)[4*stride]) + 16) >> 5)
static void dirac_hpel_filter(uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, uint8_t *src,
int stride, int width, int height)
@@ -50,28 +50,28 @@ static void dirac_hpel_filter(uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, uint8
}
}
-#define PIXOP_BILINEAR(PFX, OP, WIDTH) \
-static void ff_ ## PFX ## _dirac_pixels ## WIDTH ## _bilinear_c(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
-{\
- int x;\
- const uint8_t *s0 = src[0];\
- const uint8_t *s1 = src[1];\
- const uint8_t *s2 = src[2];\
- const uint8_t *s3 = src[3];\
- const uint8_t *w = src[4];\
-\
- while (h--) {\
- for (x = 0; x < WIDTH; x++) {\
- OP(dst[x], (s0[x]*w[0] + s1[x]*w[1] + s2[x]*w[2] + s3[x]*w[3] + 8) >> 4);\
- }\
-\
- dst += stride;\
- s0 += stride;\
- s1 += stride;\
- s2 += stride;\
- s3 += stride;\
- }\
-}
+#define PIXOP_BILINEAR(PFX, OP, WIDTH) \
+ static void ff_ ## PFX ## _dirac_pixels ## WIDTH ## _bilinear_c(uint8_t *dst, const uint8_t *src[5], int stride, int h) \
+ { \
+ int x; \
+ const uint8_t *s0 = src[0]; \
+ const uint8_t *s1 = src[1]; \
+ const uint8_t *s2 = src[2]; \
+ const uint8_t *s3 = src[3]; \
+ const uint8_t *w = src[4]; \
+ \
+ while (h--) { \
+ for (x = 0; x < WIDTH; x++) { \
+ OP(dst[x], (s0[x]*w[0] + s1[x]*w[1] + s2[x]*w[2] + s3[x]*w[3] + 8) >> 4); \
+ } \
+ \
+ dst += stride; \
+ s0 += stride; \
+ s1 += stride; \
+ s2 += stride; \
+ s3 += stride; \
+ } \
+ }
#define OP_PUT(dst, val) (dst) = (val)
#define OP_AVG(dst, val) (dst) = (((dst) + (val) + 1)>>1)
@@ -86,50 +86,50 @@ PIXOP_BILINEAR(avg, OP_AVG, 32)
#define op_scale1(x) block[x] = av_clip_uint8( (block[x]*weight + (1<<(log2_denom-1))) >> log2_denom)
#define op_scale2(x) dst[x] = av_clip_uint8( (src[x]*weights + dst[x]*weightd + (1<<(log2_denom-1))) >> log2_denom)
-#define DIRAC_WEIGHT(W) \
-static void weight_dirac_pixels ## W ## _c(uint8_t *block, int stride, int log2_denom, \
- int weight, int h) { \
- int x; \
- while (h--) { \
- for (x = 0; x < W; x++) { \
- op_scale1(x); \
- op_scale1(x+1); \
- } \
- block += stride; \
- } \
-} \
-static void biweight_dirac_pixels ## W ## _c(uint8_t *dst, uint8_t *src, int stride, int log2_denom, \
- int weightd, int weights, int h) { \
- int x; \
- while (h--) { \
- for (x = 0; x < W; x++) { \
- op_scale2(x); \
- op_scale2(x+1); \
- } \
- dst += stride; \
- src += stride; \
- } \
-}
+#define DIRAC_WEIGHT(W) \
+ static void weight_dirac_pixels ## W ## _c(uint8_t *block, int stride, int log2_denom, \
+ int weight, int h) { \
+ int x; \
+ while (h--) { \
+ for (x = 0; x < W; x++) { \
+ op_scale1(x); \
+ op_scale1(x+1); \
+ } \
+ block += stride; \
+ } \
+ } \
+ static void biweight_dirac_pixels ## W ## _c(uint8_t *dst, uint8_t *src, int stride, int log2_denom, \
+ int weightd, int weights, int h) { \
+ int x; \
+ while (h--) { \
+ for (x = 0; x < W; x++) { \
+ op_scale2(x); \
+ op_scale2(x+1); \
+ } \
+ dst += stride; \
+ src += stride; \
+ } \
+ }
DIRAC_WEIGHT(8)
DIRAC_WEIGHT(16)
DIRAC_WEIGHT(32)
-#define ADD_OBMC(xblen) \
-static void add_obmc ## xblen ## _c(uint16_t *dst, const uint8_t *src, int stride, \
- const uint8_t *obmc_weight, int yblen) \
-{ \
- int x; \
- while (yblen--) { \
- for (x = 0; x < xblen; x += 2) { \
- dst[x ] += src[x ] * obmc_weight[x ]; \
- dst[x+1] += src[x+1] * obmc_weight[x+1]; \
- } \
- dst += stride; \
- src += stride; \
- obmc_weight += 32; \
- } \
-}
+#define ADD_OBMC(xblen) \
+ static void add_obmc ## xblen ## _c(uint16_t *dst, const uint8_t *src, int stride, \
+ const uint8_t *obmc_weight, int yblen) \
+ { \
+ int x; \
+ while (yblen--) { \
+ for (x = 0; x < xblen; x += 2) { \
+ dst[x ] += src[x ] * obmc_weight[x ]; \
+ dst[x+1] += src[x+1] * obmc_weight[x+1]; \
+ } \
+ dst += stride; \
+ src += stride; \
+ obmc_weight += 32; \
+ } \
+ }
ADD_OBMC(8)
ADD_OBMC(16)
@@ -167,7 +167,7 @@ static void add_rect_clamped_c(uint8_t *dst, const uint16_t *src, int stride,
}
}
-#define PIXFUNC(PFX, WIDTH) \
+#define PIXFUNC(PFX, WIDTH) \
c->PFX ## _dirac_pixels_tab[WIDTH>>4][0] = ff_ ## PFX ## _dirac_pixels ## WIDTH ## _c; \
c->PFX ## _dirac_pixels_tab[WIDTH>>4][1] = ff_ ## PFX ## _dirac_pixels ## WIDTH ## _l2_c; \
c->PFX ## _dirac_pixels_tab[WIDTH>>4][2] = ff_ ## PFX ## _dirac_pixels ## WIDTH ## _l4_c; \
@@ -197,5 +197,5 @@ void ff_diracdsp_init(DiracDSPContext *c)
PIXFUNC(avg, 16);
PIXFUNC(avg, 32);
- //MMX_DISABLE if (HAVE_MMX) ff_diracdsp_init_mmx(c);
+ /* MMX_DISABLE if (HAVE_MMX) ff_diracdsp_init_mmx(c); */
}