Commit 8199bb7b authored by Diego Biurrun's avatar Diego Biurrun

dsputil.h: Clean up comments

parent 0a8f91b1
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
/** /**
* @file * @file
* DSP utils. * DSP utils.
* note, many functions in here may use MMX which trashes the FPU state, it is * Note, many functions in here may use MMX which trashes the FPU state, it is
* absolutely necessary to call emms_c() between dsp & float/double code * absolutely necessary to call emms_c() between DSP & float/double code.
*/ */
#ifndef AVCODEC_DSPUTIL_H #ifndef AVCODEC_DSPUTIL_H
...@@ -61,21 +61,22 @@ void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, ...@@ -61,21 +61,22 @@ 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
for some CPU or need to use a function with less aligned data then send a mail * for some CPU or need to use a function with less aligned data then send a mail
to the libav-devel mailing list, ... * to the libav-devel mailing list, ...
*
!warning These alignments might not match reality, (missing attribute((align)) * !warning These alignments might not match reality, (missing attribute((align))
stuff somewhere possible). * stuff somewhere possible).
I (Michael) did not check them, these are just the alignments which I think * I (Michael) did not check them, these are just the alignments which I think
could be reached easily ... * could be reached easily ...
*
!future video codecs might need functions with less strict alignment * !future video codecs might need functions with less strict alignment
*/ */
/* add and put pixel (decoding) */ /* add and put pixel (decoding)
// blocksizes 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} but never larger than 16 and never smaller than 4 * h for op_pixels_func is limited to { width / 2, width },
* 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)*/, 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 (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);
...@@ -99,10 +100,14 @@ DEF_OLD_QPEL(qpel8_mc32_old_c) ...@@ -99,10 +100,14 @@ DEF_OLD_QPEL(qpel8_mc32_old_c)
DEF_OLD_QPEL(qpel8_mc13_old_c) DEF_OLD_QPEL(qpel8_mc13_old_c)
DEF_OLD_QPEL(qpel8_mc33_old_c) DEF_OLD_QPEL(qpel8_mc33_old_c)
/* motion estimation */ /* Motion estimation:
// h is limited to {width/2, width, 2*width} but never larger than 16 and never smaller than 2 * h is limited to { width / 2, width, 2 * width },
// although currently h<4 is not used as functions with width <8 are neither used nor implemented * but never larger than 16 and never smaller than 2.
typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size, int h)/* __attribute__ ((const))*/; * Although currently h < 4 is not used as functions with
* width < 8 are neither used nor implemented. */
typedef int (*me_cmp_func)(void /* MpegEncContext */ *s,
uint8_t *blk1 /* align width (8 or 16) */,
uint8_t *blk2 /* align 1 */, int line_size, int h);
/** /**
* Scantable. * Scantable.
...@@ -142,7 +147,6 @@ typedef struct DSPContext { ...@@ -142,7 +147,6 @@ typedef struct DSPContext {
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);
int (*pix_norm1)(uint8_t * pix, int line_size); int (*pix_norm1)(uint8_t * pix, int line_size);
// 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4
me_cmp_func sad[6]; /* identical to pix_absAxA except additional void * */ me_cmp_func sad[6]; /* identical to pix_absAxA except additional void * */
me_cmp_func sse[6]; me_cmp_func sse[6];
...@@ -168,10 +172,10 @@ typedef struct DSPContext { ...@@ -168,10 +172,10 @@ typedef struct DSPContext {
int size); int size);
/** /**
* Thirdpel motion compensation with rounding (a+b+1)>>1. * Thirdpel motion compensation with rounding (a + b + 1) >> 1.
* this is an array[12] of motion compensation functions for the 9 thirdpe * this is an array[12] of motion compensation functions for the
* positions<br> * 9 thirdpel positions<br>
* *pixels_tab[ xthirdpel + 4*ythirdpel ] * *pixels_tab[xthirdpel + 4 * ythirdpel]
* @param block destination where the result is stored * @param block destination where the result is stored
* @param pixels source * @param pixels source
* @param line_size number of bytes in a horizontal line of block * @param line_size number of bytes in a horizontal line of block
...@@ -187,12 +191,12 @@ typedef struct DSPContext { ...@@ -187,12 +191,12 @@ 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*/, 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); 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, const uint8_t *src2, int w, int *left, int *left_top);
void (*add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top); void (*add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top);
...@@ -225,16 +229,18 @@ typedef struct DSPContext { ...@@ -225,16 +229,18 @@ typedef struct DSPContext {
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.
* several optimized IDCTs need a permutated input (relative to the normal order of the reference * Several optimized IDCTs need a permutated input (relative to the
* IDCT) * normal order of the reference IDCT).
* this permutation must be performed before the idct_put/add, note, normally this can be merged * This permutation must be performed before the idct_put/add.
* with the zigzag/alternate scan<br> * Note, normally this can be merged with the zigzag/alternate scan<br>
* an example to avoid confusion: * An example to avoid confusion:
* - (->decode coeffs -> zigzag reorder -> dequant -> reference idct ->...) * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
* - (x -> reference dct -> reference idct -> x) * - (x -> reference DCT -> reference IDCT -> x)
* - (x -> reference dct -> simple_mmx_perm = idct_permutation -> simple_idct_mmx -> x) * - (x -> reference DCT -> simple_mmx_perm = idct_permutation
* - (->decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant -> simple_idct_mmx ->...) * -> simple_idct_mmx -> x)
* - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
* -> simple_idct_mmx -> ...)
*/ */
uint8_t idct_permutation[64]; uint8_t idct_permutation[64];
int idct_permutation_type; int idct_permutation_type;
...@@ -271,7 +277,8 @@ typedef struct DSPContext { ...@@ -271,7 +277,8 @@ typedef struct DSPContext {
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 maximum value. * Clip each element in an array of int32_t to a given minimum and
* maximum value.
* @param dst destination array * @param dst destination array
* constraints: 16-byte aligned * constraints: 16-byte aligned
* @param src source array * @param src source array
......
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