Browse code

Merge commit '8199bb7be0db423bcbbd252d092386634fcf1d68'

* commit '8199bb7be0db423bcbbd252d092386634fcf1d68':
dsputil.h: Clean up comments

Conflicts:
libavcodec/dsputil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/03/14 08:10:31
Showing 1 changed files
... ...
@@ -23,8 +23,8 @@
23 23
 /**
24 24
  * @file
25 25
  * DSP utils.
26
- * note, many functions in here may use MMX which trashes the FPU state, it is
27
- * absolutely necessary to call emms_c() between dsp & float/double code
26
+ * Note, many functions in here may use MMX which trashes the FPU state, it is
27
+ * absolutely necessary to call emms_c() between DSP & float/double code.
28 28
  */
29 29
 
30 30
 #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 61
               int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
62 62
 
63 63
 /* minimum alignment rules ;)
64
-If you notice errors in the align stuff, need more alignment for some ASM code
65
-for some CPU or need to use a function with less aligned data then send a mail
66
-to the ffmpeg-devel mailing list, ...
67
-
68
-!warning These alignments might not match reality, (missing attribute((align))
69
-stuff somewhere possible).
70
-I (Michael) did not check them, these are just the alignments which I think
71
-could be reached easily ...
72
-
73
-!future video codecs might need functions with less strict alignment
74
-*/
64
+ * If you notice errors in the align stuff, need more alignment for some ASM code
65
+ * for some CPU or need to use a function with less aligned data then send a mail
66
+ * to the ffmpeg-devel mailing list, ...
67
+ *
68
+ * !warning These alignments might not match reality, (missing attribute((align))
69
+ * stuff somewhere possible).
70
+ * I (Michael) did not check them, these are just the alignments which I think
71
+ * could be reached easily ...
72
+ *
73
+ * !future video codecs might need functions with less strict alignment
74
+ */
75 75
 
76
-/* add and put pixel (decoding) */
77
-// blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
78
-//h for op_pixels_func is limited to {width/2, width} but never larger than 16 and never smaller than 4
76
+/* add and put pixel (decoding)
77
+ * Block sizes for op_pixels_func are 8x4,8x8 16x8 16x16.
78
+ * h for op_pixels_func is limited to { width / 2, width },
79
+ * but never larger than 16 and never smaller than 4. */
79 80
 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);
80 81
 typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, ptrdiff_t stride);
81 82
 
... ...
@@ -99,10 +100,14 @@ DEF_OLD_QPEL(qpel8_mc32_old_c)
99 99
 DEF_OLD_QPEL(qpel8_mc13_old_c)
100 100
 DEF_OLD_QPEL(qpel8_mc33_old_c)
101 101
 
102
-/* motion estimation */
103
-// h is limited to {width/2, width, 2*width} but never larger than 16 and never smaller than 2
104
-// although currently h<4 is not used as functions with width <8 are neither used nor implemented
105
-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))*/;
102
+/* Motion estimation:
103
+ * h is limited to { width / 2, width, 2 * width },
104
+ * but never larger than 16 and never smaller than 2.
105
+ * Although currently h < 4 is not used as functions with
106
+ * width < 8 are neither used nor implemented. */
107
+typedef int (*me_cmp_func)(void /* MpegEncContext */ *s,
108
+                           uint8_t *blk1 /* align width (8 or 16) */,
109
+                           uint8_t *blk2 /* align 1 */, int line_size, int h);
106 110
 
107 111
 /**
108 112
  * Scantable.
... ...
@@ -142,7 +147,6 @@ typedef struct DSPContext {
142 142
     void (*clear_blocks)(int16_t *blocks/*align 16*/);
143 143
     int (*pix_sum)(uint8_t * pix, int line_size);
144 144
     int (*pix_norm1)(uint8_t * pix, int line_size);
145
-// 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4
146 145
 
147 146
     me_cmp_func sad[6]; /* identical to pix_absAxA except additional void * */
148 147
     me_cmp_func sse[6];
... ...
@@ -170,10 +174,10 @@ typedef struct DSPContext {
170 170
                              int size);
171 171
 
172 172
     /**
173
-     * Thirdpel motion compensation with rounding (a+b+1)>>1.
174
-     * this is an array[12] of motion compensation functions for the 9 thirdpe
175
-     * positions<br>
176
-     * *pixels_tab[ xthirdpel + 4*ythirdpel ]
173
+     * Thirdpel motion compensation with rounding (a + b + 1) >> 1.
174
+     * this is an array[12] of motion compensation functions for the
175
+     * 9 thirdpel positions<br>
176
+     * *pixels_tab[xthirdpel + 4 * ythirdpel]
177 177
      * @param block destination where the result is stored
178 178
      * @param pixels source
179 179
      * @param line_size number of bytes in a horizontal line of block
... ...
@@ -189,12 +193,12 @@ typedef struct DSPContext {
189 189
 
190 190
     me_cmp_func pix_abs[2][4];
191 191
 
192
-    /* huffyuv specific */
192
+    /* HuffYUV specific */
193 193
     void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w);
194 194
     void (*diff_bytes)(uint8_t *dst/*align 16*/, const uint8_t *src1/*align 16*/, const uint8_t *src2/*align 1*/,int w);
195 195
     /**
196
-     * subtract huffyuv's variant of median prediction
197
-     * note, this might read from src1[-1], src2[-1]
196
+     * Subtract HuffYUV's variant of median prediction.
197
+     * Note, this might read from src1[-1], src2[-1].
198 198
      */
199 199
     void (*sub_hfyu_median_prediction)(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top);
200 200
     void (*add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top);
... ...
@@ -228,16 +232,18 @@ typedef struct DSPContext {
228 228
     void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/);
229 229
 
230 230
     /**
231
-     * idct input permutation.
232
-     * several optimized IDCTs need a permutated input (relative to the normal order of the reference
233
-     * IDCT)
234
-     * this permutation must be performed before the idct_put/add, note, normally this can be merged
235
-     * with the zigzag/alternate scan<br>
236
-     * an example to avoid confusion:
237
-     * - (->decode coeffs -> zigzag reorder -> dequant -> reference idct ->...)
238
-     * - (x -> reference dct -> reference idct -> x)
239
-     * - (x -> reference dct -> simple_mmx_perm = idct_permutation -> simple_idct_mmx -> x)
240
-     * - (->decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant -> simple_idct_mmx ->...)
231
+     * IDCT input permutation.
232
+     * Several optimized IDCTs need a permutated input (relative to the
233
+     * normal order of the reference IDCT).
234
+     * This permutation must be performed before the idct_put/add.
235
+     * Note, normally this can be merged with the zigzag/alternate scan<br>
236
+     * An example to avoid confusion:
237
+     * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
238
+     * - (x -> reference DCT -> reference IDCT -> x)
239
+     * - (x -> reference DCT -> simple_mmx_perm = idct_permutation
240
+     *    -> simple_idct_mmx -> x)
241
+     * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
242
+     *    -> simple_idct_mmx -> ...)
241 243
      */
242 244
     uint8_t idct_permutation[64];
243 245
     int idct_permutation_type;
... ...
@@ -274,7 +280,8 @@ typedef struct DSPContext {
274 274
     int32_t (*scalarproduct_and_madd_int16)(int16_t *v1/*align 16*/, const int16_t *v2, const int16_t *v3, int len, int mul);
275 275
 
276 276
     /**
277
-     * Clip each element in an array of int32_t to a given minimum and maximum value.
277
+     * Clip each element in an array of int32_t to a given minimum and
278
+     * maximum value.
278 279
      * @param dst  destination array
279 280
      *             constraints: 16-byte aligned
280 281
      * @param src  source array