]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dsputil.h
avcodec/hevc: check slice_header_extension data length
[ffmpeg] / libavcodec / dsputil.h
index f8b7b0d892fd5df99cb08c45fccd6d0a23eb7dec..9010729b90633da3a30a8635836b62af0e430ccf 100644 (file)
@@ -3,20 +3,20 @@
  * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
  * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
  *
- * This file is part of Libav.
+ * This file is part of FFmpeg.
  *
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 
 extern uint32_t ff_square_tab[512];
 
+
+/* minimum alignment rules ;)
+ * 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
+ * to the ffmpeg-devel mailing list, ...
+ *
+ * !warning These alignments might not match reality, (missing attribute((align))
+ * stuff somewhere possible).
+ * I (Michael) did not check them, these are just the alignments which I think
+ * could be reached easily ...
+ *
+ * !future video codecs might need functions with less strict alignment
+ */
+
 struct MpegEncContext;
 /* Motion estimation:
  * h is limited to { width / 2, width, 2 * width },
@@ -48,19 +62,8 @@ typedef int (*me_cmp_func)(struct MpegEncContext *c,
  * DSPContext.
  */
 typedef struct DSPContext {
-    /* pixel ops : interface with DCT */
-    void (*get_pixels)(int16_t *block /* align 16 */,
-                       const uint8_t *pixels /* align 8 */,
-                       int line_size);
-    void (*diff_pixels)(int16_t *block /* align 16 */,
-                        const uint8_t *s1 /* align 8 */,
-                        const uint8_t *s2 /* align 8 */,
-                        int stride);
     int (*sum_abs_dctelem)(int16_t *block /* align 16 */);
 
-    int (*pix_sum)(uint8_t *pix, int line_size);
-    int (*pix_norm1)(uint8_t *pix, int line_size);
-
     me_cmp_func sad[6]; /* identical to pix_absAxA except additional void * */
     me_cmp_func sse[6];
     me_cmp_func hadamard8_diff[6];
@@ -71,6 +74,8 @@ typedef struct DSPContext {
     me_cmp_func vsad[6];
     me_cmp_func vsse[6];
     me_cmp_func nsse[6];
+    me_cmp_func w53[6];
+    me_cmp_func w97[6];
     me_cmp_func dct_max[6];
     me_cmp_func dct264_sad[6];
 
@@ -82,31 +87,22 @@ typedef struct DSPContext {
     me_cmp_func frame_skip_cmp[6]; // only width 8 used
 
     me_cmp_func pix_abs[2][4];
-
-    /* (I)DCT */
-    void (*fdct)(int16_t *block /* align 16 */);
-    void (*fdct248)(int16_t *block /* align 16 */);
-
-    void (*draw_edges)(uint8_t *buf, int wrap, int width, int height,
-                       int w, int h, int sides);
-#define EDGE_WIDTH 16
-#define EDGE_TOP    1
-#define EDGE_BOTTOM 2
-
-    void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src,
-                      int src_wrap, int width, int height);
 } DSPContext;
 
 void ff_dsputil_static_init(void);
 void ff_dsputil_init(DSPContext *p, AVCodecContext *avctx);
+void avpriv_dsputil_init(DSPContext* p, AVCodecContext *avctx);
+attribute_deprecated void dsputil_init(DSPContext* c, AVCodecContext *avctx);
+
+int ff_check_alignment(void);
 
 void ff_set_cmp(DSPContext *c, me_cmp_func *cmp, int type);
 
-void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx,
-                         unsigned high_bit_depth);
-void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx,
-                         unsigned high_bit_depth);
-void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx,
-                         unsigned high_bit_depth);
+void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
+void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx);
+void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx);
+void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx);
+
+void ff_dsputil_init_dwt(DSPContext *c);
 
 #endif /* AVCODEC_DSPUTIL_H */