dsputil.h: K&R formatting cosmetics

This commit is contained in:
Diego Biurrun 2013-12-22 17:50:07 +01:00
parent 8199bb7be0
commit 503dda7d4f

View File

@ -58,7 +58,8 @@ void ff_put_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
void ff_avg_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride); void ff_avg_rv40_qpel8_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height); int dxx, int dxy, int dyx, int dyy, int shift, int r,
int width, int height);
/* minimum alignment rules ;) /* minimum alignment rules ;)
* If you notice errors in the align stuff, need more alignment for some ASM code * If you notice errors in the align stuff, need more alignment for some ASM code
@ -77,15 +78,22 @@ void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
* Block sizes for op_pixels_func are 8x4,8x8 16x8 16x16. * Block sizes for op_pixels_func are 8x4,8x8 16x8 16x16.
* h for op_pixels_func is limited to { width / 2, width }, * h for op_pixels_func is limited to { width / 2, width },
* but never larger than 16 and never smaller than 4. */ * but never larger than 16 and never smaller than 4. */
typedef void (*tpel_mc_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int w, int h); typedef void (*tpel_mc_func)(uint8_t *block /* align width (8 or 16) */,
typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride); const uint8_t *pixels /* align 1 */,
int line_size, int w, int h);
typedef void (*qpel_mc_func)(uint8_t *dst /* align width (8 or 16) */,
uint8_t *src /* align 1 */, ptrdiff_t stride);
typedef void (*op_fill_func)(uint8_t *block/*align width (8 or 16)*/, uint8_t value, int line_size, int h); typedef void (*op_fill_func)(uint8_t *block /* align width (8 or 16) */,
uint8_t value, int line_size, int h);
#define DEF_OLD_QPEL(name) \ #define DEF_OLD_QPEL(name) \
void ff_put_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);\ void ff_put_ ## name(uint8_t *dst /* align width (8 or 16) */, \
void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);\ uint8_t *src /* align 1 */, ptrdiff_t stride); \
void ff_avg_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride); void ff_put_no_rnd_ ## name(uint8_t *dst /* align width (8 or 16) */, \
uint8_t *src /* align 1 */, ptrdiff_t stride); \
void ff_avg_ ## name(uint8_t *dst /* align width (8 or 16) */, \
uint8_t *src /* align 1 */, ptrdiff_t stride);
DEF_OLD_QPEL(qpel16_mc11_old_c) DEF_OLD_QPEL(qpel16_mc11_old_c)
DEF_OLD_QPEL(qpel16_mc31_old_c) DEF_OLD_QPEL(qpel16_mc31_old_c)
@ -118,7 +126,8 @@ typedef struct ScanTable{
uint8_t raster_end[64]; uint8_t raster_end[64];
} ScanTable; } ScanTable;
void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable); void ff_init_scantable(uint8_t *permutation, ScanTable *st,
const uint8_t *src_scantable);
void ff_init_scantable_permutation(uint8_t *idct_permutation, void ff_init_scantable_permutation(uint8_t *idct_permutation,
int idct_permutation_type); int idct_permutation_type);
@ -127,22 +136,36 @@ void ff_init_scantable_permutation(uint8_t *idct_permutation,
*/ */
typedef struct DSPContext { typedef struct DSPContext {
/* pixel ops : interface with DCT */ /* pixel ops : interface with DCT */
void (*get_pixels)(int16_t *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size); void (*get_pixels)(int16_t *block /* align 16 */,
void (*diff_pixels)(int16_t *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride); const uint8_t *pixels /* align 8 */,
void (*put_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); int line_size);
void (*put_signed_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); void (*diff_pixels)(int16_t *block /* align 16 */,
void (*add_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); const uint8_t *s1 /* align 8 */,
const uint8_t *s2 /* align 8 */,
int stride);
void (*put_pixels_clamped)(const int16_t *block /* align 16 */,
uint8_t *pixels /* align 8 */,
int line_size);
void (*put_signed_pixels_clamped)(const int16_t *block /* align 16 */,
uint8_t *pixels /* align 8 */,
int line_size);
void (*add_pixels_clamped)(const int16_t *block /* align 16 */,
uint8_t *pixels /* align 8 */,
int line_size);
void (*add_pixels8)(uint8_t *pixels, int16_t *block, int line_size); void (*add_pixels8)(uint8_t *pixels, int16_t *block, int line_size);
int (*sum_abs_dctelem)(int16_t *block /* align 16 */); int (*sum_abs_dctelem)(int16_t *block /* align 16 */);
/** /**
* translational global motion compensation. * translational global motion compensation.
*/ */
void (*gmc1)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder); void (*gmc1)(uint8_t *dst /* align 8 */, uint8_t *src /* align 1 */,
int srcStride, int h, int x16, int y16, int rounder);
/** /**
* global motion compensation. * global motion compensation.
*/ */
void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy, void (*gmc)(uint8_t *dst /* align 8 */, uint8_t *src /* align 1 */,
int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height); int stride, int h, int ox, int oy,
int dxx, int dxy, int dyx, int dyy,
int shift, int r, int width, int height);
void (*clear_block)(int16_t *block /* align 16 */); void (*clear_block)(int16_t *block /* align 16 */);
void (*clear_blocks)(int16_t *blocks /* align 16 */); void (*clear_blocks)(int16_t *blocks /* align 16 */);
int (*pix_sum)(uint8_t *pix, int line_size); int (*pix_sum)(uint8_t *pix, int line_size);
@ -192,21 +215,35 @@ typedef struct DSPContext {
me_cmp_func pix_abs[2][4]; me_cmp_func pix_abs[2][4];
/* HuffYUV specific */ /* HuffYUV specific */
void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w); void (*add_bytes)(uint8_t *dst /* align 16 */,
void (*diff_bytes)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 1*/,int w); uint8_t *src /* align 16 */,
int w);
void (*diff_bytes)(uint8_t *dst /* align 16 */,
uint8_t *src1 /* align 16 */,
uint8_t *src2 /* align 1 */,
int w);
/** /**
* Subtract HuffYUV's variant of median prediction. * Subtract HuffYUV's variant of median prediction.
* Note, this might read from src1[-1], src2[-1]. * Note, this might read from src1[-1], src2[-1].
*/ */
void (*sub_hfyu_median_prediction)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top); void (*sub_hfyu_median_prediction)(uint8_t *dst, const uint8_t *src1,
void (*add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top); const uint8_t *src2, int w,
int (*add_hfyu_left_prediction)(uint8_t *dst, const uint8_t *src, int w, int left); int *left, int *left_top);
void (*add_hfyu_left_prediction_bgr32)(uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue, int *alpha); void (*add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top,
const uint8_t *diff, int w,
int *left, int *left_top);
int (*add_hfyu_left_prediction)(uint8_t *dst, const uint8_t *src,
int w, int left);
void (*add_hfyu_left_prediction_bgr32)(uint8_t *dst, const uint8_t *src,
int w, int *red, int *green,
int *blue, int *alpha);
void (*bswap_buf)(uint32_t *dst, const uint32_t *src, int w); void (*bswap_buf)(uint32_t *dst, const uint32_t *src, int w);
void (*bswap16_buf)(uint16_t *dst, const uint16_t *src, int len); void (*bswap16_buf)(uint16_t *dst, const uint16_t *src, int len);
/* assume len is a multiple of 8, and arrays are 16-byte aligned */ /* assume len is a multiple of 8, and arrays are 16-byte aligned */
void (*vector_clipf)(float *dst /* align 16 */, const float *src /* align 16 */, float min, float max, int len /* align 16 */); void (*vector_clipf)(float *dst /* align 16 */,
const float *src /* align 16 */,
float min, float max, int len /* align 16 */);
/* (I)DCT */ /* (I)DCT */
void (*fdct)(int16_t *block /* align 16 */); void (*fdct)(int16_t *block /* align 16 */);
@ -220,13 +257,15 @@ typedef struct DSPContext {
* (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...) * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
* @param line_size size in bytes of a horizontal line of dest * @param line_size size in bytes of a horizontal line of dest
*/ */
void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/); void (*idct_put)(uint8_t *dest /* align 8 */,
int line_size, int16_t *block /* align 16 */);
/** /**
* block -> idct -> add dest -> clip to unsigned 8 bit -> dest. * block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
* @param line_size size in bytes of a horizontal line of dest * @param line_size size in bytes of a horizontal line of dest
*/ */
void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/); void (*idct_add)(uint8_t *dest /* align 8 */,
int line_size, int16_t *block /* align 16 */);
/** /**
* IDCT input permutation. * IDCT input permutation.
@ -251,30 +290,37 @@ typedef struct DSPContext {
#define FF_PARTTRANS_IDCT_PERM 5 #define FF_PARTTRANS_IDCT_PERM 5
#define FF_SSE2_IDCT_PERM 6 #define FF_SSE2_IDCT_PERM 6
int (*try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale); int (*try_8x8basis)(int16_t rem[64], int16_t weight[64],
int16_t basis[64], int scale);
void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale); void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale);
#define BASIS_SHIFT 16 #define BASIS_SHIFT 16
#define RECON_SHIFT 6 #define RECON_SHIFT 6
void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w, int h, int sides); void (*draw_edges)(uint8_t *buf, int wrap, int width, int height,
int w, int h, int sides);
#define EDGE_WIDTH 16 #define EDGE_WIDTH 16
#define EDGE_TOP 1 #define EDGE_TOP 1
#define EDGE_BOTTOM 2 #define EDGE_BOTTOM 2
void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src,
int src_wrap, int width, int height);
/** /**
* Calculate scalar product of two vectors. * Calculate scalar product of two vectors.
* @param len length of vectors, should be multiple of 16 * @param len length of vectors, should be multiple of 16
*/ */
int32_t (*scalarproduct_int16)(const int16_t *v1, const int16_t *v2/*align 16*/, int len); int32_t (*scalarproduct_int16)(const int16_t *v1,
const int16_t *v2 /* align 16 */, int len);
/* ape functions */ /* ape functions */
/** /**
* Calculate scalar product of v1 and v2, * Calculate scalar product of v1 and v2,
* and v1[i] += v3[i] * mul * and v1[i] += v3[i] * mul
* @param len length of vectors, should be multiple of 16 * @param len length of vectors, should be multiple of 16
*/ */
int32_t (*scalarproduct_and_madd_int16)(int16_t *v1/*align 16*/, const int16_t *v2, const int16_t *v3, int len, int mul); int32_t (*scalarproduct_and_madd_int16)(int16_t *v1 /* align 16 */,
const int16_t *v2,
const int16_t *v3,
int len, int mul);
/** /**
* Clip each element in an array of int32_t to a given minimum and * Clip each element in an array of int32_t to a given minimum and