Commit 49aa3974 authored by Jordi Ortiz's avatar Jordi Ortiz Committed by Michael Niedermayer

Dirac: More formating

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ca239e1c
......@@ -20,13 +20,14 @@
*/
/**
* @file libavcodec/dirac_arith.c
* @file
* Arithmetic decoder for Dirac
* @author Marco Gerards <marco@gnu.org>
*/
#include "dirac_arith.h"
const uint16_t ff_dirac_prob[256] = {
0, 2, 5, 8, 11, 15, 20, 24,
29, 35, 41, 47, 53, 60, 67, 74,
......
......@@ -20,7 +20,7 @@
*/
/**
* @file libavcodec/dirac_arith.h
* @file
* Arithmetic decoder for Dirac
* @author Marco Gerards <marco@gnu.org>
*/
......
......@@ -37,8 +37,6 @@
#include "dirac.h"
#include "diracdsp.h"
#undef printf
/**
* The spec limits the number of wavelet decompositions to 4 for both
* level 1 (VC-2) and 128 (long-gop default).
......@@ -81,7 +79,6 @@
typedef struct {
AVFrame avframe;
int interpolated[3]; /* 1 if hpel[] is valid */
uint8_t *hpel[3][4];
uint8_t *hpel_base[3][4];
......
......@@ -20,7 +20,7 @@
#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]) \
......@@ -51,27 +51,27 @@ 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;\
}\
}
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)
......@@ -87,7 +87,7 @@ PIXOP_BILINEAR(avg, OP_AVG, 32)
#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, \
static void weight_dirac_pixels ## W ## _c(uint8_t *block, int stride, int log2_denom, \
int weight, int h) { \
int x; \
while (h--) { \
......@@ -97,8 +97,8 @@ static void weight_dirac_pixels ## W ## _c(uint8_t *block, int stride, int log2_
} \
block += stride; \
} \
} \
static void biweight_dirac_pixels ## W ## _c(uint8_t *dst, uint8_t *src, int stride, int log2_denom, \
} \
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--) { \
......@@ -109,16 +109,16 @@ static void biweight_dirac_pixels ## W ## _c(uint8_t *dst, uint8_t *src, int str
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, \
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) { \
......@@ -129,7 +129,7 @@ static void add_obmc ## xblen ## _c(uint16_t *dst, const uint8_t *src, int strid
src += stride; \
obmc_weight += 32; \
} \
}
}
ADD_OBMC(8)
ADD_OBMC(16)
......@@ -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); */
}
......@@ -27,24 +27,24 @@ void ff_put_signed_rect_clamped_mmx(uint8_t *dst, int dst_stride, const int16_t
void ff_put_signed_rect_clamped_sse2(uint8_t *dst, int dst_stride, const int16_t *src, int src_stride, int width, int height);
#define HPEL_FILTER(MMSIZE, EXT) \
void ff_dirac_hpel_filter_v_ ## EXT(uint8_t *, uint8_t *, int, int);\
void ff_dirac_hpel_filter_h_ ## EXT(uint8_t *, uint8_t *, int);\
\
static void dirac_hpel_filter_ ## EXT(uint8_t *dsth, uint8_t *dstv, uint8_t *dstc,\
uint8_t *src, int stride, int width, int height)\
{\
while( height-- )\
{\
ff_dirac_hpel_filter_v_ ## EXT(dstv-MMSIZE, src-MMSIZE, stride, width+MMSIZE+5);\
ff_dirac_hpel_filter_h_ ## EXT(dsth, src, width);\
ff_dirac_hpel_filter_h_ ## EXT(dstc, dstv, width);\
\
dsth += stride;\
dstv += stride;\
dstc += stride;\
src += stride;\
}\
}
void ff_dirac_hpel_filter_v_ ## EXT(uint8_t *, uint8_t *, int, int); \
void ff_dirac_hpel_filter_h_ ## EXT(uint8_t *, uint8_t *, int); \
\
static void dirac_hpel_filter_ ## EXT(uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, \
uint8_t *src, int stride, int width, int height) \
{ \
while( height-- ) \
{ \
ff_dirac_hpel_filter_v_ ## EXT(dstv-MMSIZE, src-MMSIZE, stride, width+MMSIZE+5); \
ff_dirac_hpel_filter_h_ ## EXT(dsth, src, width); \
ff_dirac_hpel_filter_h_ ## EXT(dstc, dstv, width); \
\
dsth += stride; \
dstv += stride; \
dstc += stride; \
src += stride; \
} \
}
#if !ARCH_X86_64
HPEL_FILTER(8, mmx)
......
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