diff options
Diffstat (limited to 'libavcodec/dsputil.h')
-rw-r--r-- | libavcodec/dsputil.h | 94 |
1 files changed, 18 insertions, 76 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index ce4469dc5c..29a2710fee 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -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 */ @@ -32,6 +32,7 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "rnd_avg.h" //#define DEBUG @@ -47,22 +48,12 @@ extern const uint8_t ff_zigzag248_direct[64]; /* temporary */ extern uint32_t ff_squareTbl[512]; -extern uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP]; +extern const uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP]; -#define PUTAVG_PIXELS(depth)\ -void ff_put_pixels8x8_ ## depth ## _c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);\ -void ff_avg_pixels8x8_ ## depth ## _c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);\ -void ff_put_pixels16x16_ ## depth ## _c(uint8_t *dst, uint8_t *src, ptrdiff_t stride);\ -void ff_avg_pixels16x16_ ## depth ## _c(uint8_t *dst, uint8_t *src, ptrdiff_t stride); - -PUTAVG_PIXELS( 8) -PUTAVG_PIXELS( 9) -PUTAVG_PIXELS(10) - -#define ff_put_pixels8x8_c ff_put_pixels8x8_8_c -#define ff_avg_pixels8x8_c ff_avg_pixels8x8_8_c -#define ff_put_pixels16x16_c ff_put_pixels16x16_8_c -#define ff_avg_pixels16x16_c ff_avg_pixels16x16_8_c +void ff_put_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride); +void ff_avg_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride); +void ff_put_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride); +void ff_avg_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride); /* RV40 functions */ void ff_put_rv40_qpel16_mc33_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride); @@ -76,7 +67,7 @@ void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, /* 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 libav-devel mailing list, ... +to the ffmpeg-devel mailing list, ... !warning These alignments might not match reality, (missing attribute((align)) stuff somewhere possible). @@ -89,7 +80,6 @@ could be reached easily ... /* add and put pixel (decoding) */ // blocksizes 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 -typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, ptrdiff_t line_size, 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); @@ -113,12 +103,6 @@ DEF_OLD_QPEL(qpel8_mc32_old_c) DEF_OLD_QPEL(qpel8_mc13_old_c) DEF_OLD_QPEL(qpel8_mc33_old_c) -#define CALL_2X_PIXELS(a, b, n)\ -static void a(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\ - b(block , pixels , line_size, h);\ - b(block+n, pixels+n, line_size, h);\ -} - /* motion estimation */ // h is limited to {width/2, width, 2*width} but never larger than 16 and never smaller than 2 // although currently h<4 is not used as functions with width <8 are neither used nor implemented @@ -179,6 +163,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]; @@ -193,54 +179,6 @@ typedef struct DSPContext { int size); /** - * Halfpel motion compensation with rounding (a+b+1)>>1. - * this is an array[4][4] of motion compensation functions for 4 - * horizontal blocksizes (8,16) and the 4 halfpel positions<br> - * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ] - * @param block destination where the result is stored - * @param pixels source - * @param line_size number of bytes in a horizontal line of block - * @param h height - */ - op_pixels_func put_pixels_tab[4][4]; - - /** - * Halfpel motion compensation with rounding (a+b+1)>>1. - * This is an array[4][4] of motion compensation functions for 4 - * horizontal blocksizes (8,16) and the 4 halfpel positions<br> - * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ] - * @param block destination into which the result is averaged (a+b+1)>>1 - * @param pixels source - * @param line_size number of bytes in a horizontal line of block - * @param h height - */ - op_pixels_func avg_pixels_tab[4][4]; - - /** - * Halfpel motion compensation with no rounding (a+b)>>1. - * this is an array[2][4] of motion compensation functions for 2 - * horizontal blocksizes (8,16) and the 4 halfpel positions<br> - * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ] - * @param block destination where the result is stored - * @param pixels source - * @param line_size number of bytes in a horizontal line of block - * @param h height - */ - op_pixels_func put_no_rnd_pixels_tab[2][4]; - - /** - * Halfpel motion compensation with no rounding (a+b)>>1. - * this is an array[4] of motion compensation functions for 1 - * horizontal blocksize (16) and the 4 halfpel positions<br> - * *pixels_tab[0][ xhalfpel + 2*yhalfpel ] - * @param block destination into which the result is averaged (a+b)>>1 - * @param pixels source - * @param line_size number of bytes in a horizontal line of block - * @param h height - */ - op_pixels_func avg_no_rnd_pixels_tab[4]; - - /** * Thirdpel motion compensation with rounding (a+b+1)>>1. * this is an array[12] of motion compensation functions for the 9 thirdpe * positions<br> @@ -262,7 +200,7 @@ typedef struct DSPContext { /* huffyuv specific */ 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*/, const uint8_t *src1/*align 16*/, const uint8_t *src2/*align 1*/,int w); /** * subtract huffyuv's variant of median prediction * note, this might read from src1[-1], src2[-1] @@ -271,6 +209,7 @@ typedef struct DSPContext { 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); + /* this might write to dst[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); @@ -383,6 +322,7 @@ typedef struct DSPContext { void ff_dsputil_static_init(void); void ff_dsputil_init(DSPContext* p, AVCodecContext *avctx); +attribute_deprecated void dsputil_init(DSPContext* c, AVCodecContext *avctx); int ff_check_alignment(void); @@ -396,4 +336,6 @@ void ff_dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx); void ff_dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx); void ff_dsputil_init_vis(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_dwt(DSPContext *c); + #endif /* AVCODEC_DSPUTIL_H */ |