gavl

- Main Page
- Modules
- Data Structures
- Files
- Directories

- File List
- Globals

# gavldsp.h

    00001 /*****************************************************************
    00002  * gavl - a general purpose audio/video processing library
    00003  *
    00004  * Copyright (c) 2001 - 2011 Members of the Gmerlin project
    00005  * gmerlin-general@lists.sourceforge.net
    00006  * http://gmerlin.sourceforge.net
    00007  *
    00008  * This program is free software: you can redistribute it and/or modify
    00009  * it under the terms of the GNU General Public License as published by
    00010  * the Free Software Foundation, either version 2 of the License, or
    00011  * (at your option) any later version.
    00012  *
    00013  * This program is distributed in the hope that it will be useful,
    00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00016  * GNU General Public License for more details.
    00017  *
    00018  * You should have received a copy of the GNU General Public License
    00019  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    00020  * *****************************************************************/
    00021
    00022 #ifndef GAVLDSP_H_INCLUDED
    00023 #define GAVLDSP_H_INCLUDED
    00024
    00025 #include <gavl/gavldefs.h>
    00026
    00045 typedef struct gavl_dsp_context_s gavl_dsp_context_t;
    00046
    00053 typedef struct
    00054   {
    00068   int (*sad_rgb15)(const uint8_t * src_1, const uint8_t * src_2,
    00069                    int stride_1, int stride_2,
    00070                    int w, int h);
    00071
    00085   int (*sad_rgb16)(const uint8_t * src_1, const uint8_t * src_2,
    00086                    int stride_1, int stride_2,
    00087                    int w, int h);
    00088
    00099   int (*sad_8)(const uint8_t * src_1, const uint8_t * src_2,
    00100                int stride_1, int stride_2,
    00101                int w, int h);
    00102
    00113   int (*sad_16)(const uint8_t * src_1, const uint8_t * src_2,
    00114                int stride_1, int stride_2,
    00115                int w, int h);
    00116
    00126   float (*sad_f)(const uint8_t * src_1, const uint8_t * src_2,
    00127                  int stride_1, int stride_2,
    00128                  int w, int h);
    00129
    00137   void (*average_rgb15)(const uint8_t * src_1, const uint8_t * src_2,
    00138                         uint8_t * dst, int num);
    00139
    00146   void (*average_rgb16)(const uint8_t * src_1, const uint8_t * src_2,
    00147                         uint8_t * dst, int num);
    00148
    00155   void (*average_8)(const uint8_t * src_1, const uint8_t * src_2,
    00156                     uint8_t * dst, int num);
    00157
    00164   void (*average_16)(const uint8_t * src_1, const uint8_t * src_2,
    00165                      uint8_t * dst, int num);
    00166
    00174   void (*average_f)(const uint8_t * src_1, const uint8_t * src_2,
    00175                     uint8_t * dst, int num);
    00176
    00177
    00188   void (*interpolate_rgb15)(const uint8_t * src_1, const uint8_t * src_2,
    00189                             uint8_t * dst, int num, float);
    00190
    00200   void (*interpolate_rgb16)(const uint8_t * src_1, const uint8_t * src_2,
    00201                             uint8_t * dst, int num, float fac);
    00202
    00212   void (*interpolate_8)(const uint8_t * src_1, const uint8_t * src_2,
    00213                         uint8_t * dst, int num, float fac);
    00214
    00224   void (*interpolate_16)(const uint8_t * src_1, const uint8_t * src_2,
    00225                          uint8_t * dst, int num, float fac);
    00226
    00237   void (*interpolate_f)(const uint8_t * src_1, const uint8_t * src_2,
    00238                         uint8_t * dst, int num, float fac);
    00239
    00244   void (*bswap_16)(void * ptr, int len);
    00245
    00250   void (*bswap_32)(void * ptr, int len);
    00251
    00256   void (*bswap_64)(void * ptr, int len);
    00257
    00267   void (*add_u8)(const void * src1, const void * src2, void * dst, int num);
    00268
    00277   void (*add_u8_s)(const void * src1, const void * src2, void * dst, int num);
    00278
    00287   void (*add_s8)(const void * src1, const void * src2, void * dst, int num);
    00288
    00297   void (*add_u16)(const void * src1, const void * src2, void * dst, int num);
    00298
    00307   void (*add_u16_s)(const void * src1, const void * src2, void * dst, int num);
    00308
    00317   void (*add_s16)(const void * src1, const void * src2, void * dst, int num);
    00318
    00327   void (*add_s32)(const void * src1, const void * src2, void * dst, int num);
    00328
    00337   void (*add_float)(const void * src1, const void * src2, void * dst, int num);
    00338
    00347   void (*add_double)(const void * src1, const void * src2, void * dst, int num);
    00348
    00358   void (*sub_u8)(const void * src1, const void * src2, void * dst, int num);
    00359
    00368   void (*sub_u8_s)(const void * src1, const void * src2, void * dst, int num);
    00369
    00378   void (*sub_s8)(const void * src1, const void * src2, void * dst, int num);
    00379
    00388   void (*sub_u16)(const void * src1, const void * src2, void * dst, int num);
    00389
    00398   void (*sub_u16_s)(const void * src1, const void * src2, void * dst, int num);
    00399
    00408   void (*sub_s16)(const void * src1, const void * src2, void * dst, int num);
    00409
    00418   void (*sub_s32)(const void * src1, const void * src2, void * dst, int num);
    00419
    00428   void (*sub_float)(const void * src1, const void * src2, void * dst, int num);
    00429
    00438   void (*sub_double)(const void * src1, const void * src2, void * dst, int num);
    00439
    00440
    00441   } gavl_dsp_funcs_t;
    00442
    00450 GAVL_PUBLIC
    00451 gavl_dsp_context_t * gavl_dsp_context_create();
    00452
    00460 GAVL_PUBLIC
    00461 void gavl_dsp_context_set_quality(gavl_dsp_context_t * ctx,
    00462                                   int q);
    00463
    00472 GAVL_PUBLIC
    00473 void gavl_dsp_context_set_accel_flags(gavl_dsp_context_t * ctx,
    00474                                       int flags);
    00475
    00476
    00486 GAVL_PUBLIC gavl_dsp_funcs_t *
    00487 gavl_dsp_context_get_funcs(gavl_dsp_context_t * ctx);
    00488
    00493 GAVL_PUBLIC
    00494 void gavl_dsp_context_destroy(gavl_dsp_context_t * ctx);
    00495
    00526 GAVL_PUBLIC
    00527 int gavl_dsp_interpolate_video_frame(gavl_dsp_context_t * ctx,
    00528                                       gavl_video_format_t * format,
    00529                                       gavl_video_frame_t * src_1,
    00530                                       gavl_video_frame_t * src_2,
    00531                                       gavl_video_frame_t * dst,
    00532                                       float factor);
    00533
    00546 GAVL_PUBLIC
    00547 int gavl_dsp_audio_frame_swap_endian(gavl_dsp_context_t * ctx,
    00548                                       gavl_audio_frame_t * frame,
    00549                                       const gavl_audio_format_t * format);
    00550
    00569 GAVL_PUBLIC
    00570 int gavl_dsp_video_frame_swap_endian(gavl_dsp_context_t * ctx,
    00571                                       gavl_video_frame_t * frame,
    00572                                       const gavl_video_format_t * format);
    00573
    00578 #endif // GAVLDSP_H_INCLUDED