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

# gavldsp.h

    00001 /*****************************************************************
    00002  * gavl - a general purpose audio/video processing library
    00003  *
    00004  * Copyright (c) 2001 - 2008 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
    00044 typedef struct gavl_dsp_context_s gavl_dsp_context_t;
    00045
    00052 typedef struct
    00053   {
    00067   int (*sad_rgb15)(uint8_t * src_1, uint8_t * src_2,
    00068                    int stride_1, int stride_2,
    00069                    int w, int h);
    00070
    00084   int (*sad_rgb16)(uint8_t * src_1, uint8_t * src_2,
    00085                    int stride_1, int stride_2,
    00086                    int w, int h);
    00087
    00098   int (*sad_8)(uint8_t * src_1, uint8_t * src_2,
    00099                int stride_1, int stride_2,
    00100                int w, int h);
    00101
    00112   int (*sad_16)(uint8_t * src_1, uint8_t * src_2,
    00113                int stride_1, int stride_2,
    00114                int w, int h);
    00115
    00125   float (*sad_f)(uint8_t * src_1, uint8_t * src_2,
    00126                  int stride_1, int stride_2,
    00127                  int w, int h);
    00128
    00136   void (*average_rgb15)(uint8_t * src_1, uint8_t * src_2,
    00137                         uint8_t * dst, int num);
    00138
    00145   void (*average_rgb16)(uint8_t * src_1, uint8_t * src_2,
    00146                         uint8_t * dst, int num);
    00147
    00154   void (*average_8)(uint8_t * src_1, uint8_t * src_2,
    00155                     uint8_t * dst, int num);
    00156
    00163   void (*average_16)(uint8_t * src_1, uint8_t * src_2,
    00164                      uint8_t * dst, int num);
    00165
    00173   void (*average_f)(uint8_t * src_1, uint8_t * src_2,
    00174                     uint8_t * dst, int num);
    00175
    00176
    00187   void (*interpolate_rgb15)(uint8_t * src_1, uint8_t * src_2,
    00188                             uint8_t * dst, int num, float);
    00189
    00199   void (*interpolate_rgb16)(uint8_t * src_1, uint8_t * src_2,
    00200                             uint8_t * dst, int num, float fac);
    00201
    00211   void (*interpolate_8)(uint8_t * src_1, uint8_t * src_2,
    00212                         uint8_t * dst, int num, float fac);
    00213
    00223   void (*interpolate_16)(uint8_t * src_1, uint8_t * src_2,
    00224                          uint8_t * dst, int num, float fac);
    00225
    00236   void (*interpolate_f)(uint8_t * src_1, uint8_t * src_2,
    00237                         uint8_t * dst, int num, float fac);
    00238
    00243   void (*bswap_16)(void * ptr, int len);
    00244
    00249   void (*bswap_32)(void * ptr, int len);
    00250
    00255   void (*bswap_64)(void * ptr, int len);
    00256
    00257   } gavl_dsp_funcs_t;
    00258
    00266 gavl_dsp_context_t * gavl_dsp_context_create();
    00267
    00275 void gavl_dsp_context_set_quality(gavl_dsp_context_t * ctx,
    00276                                   int q);
    00277
    00286 void gavl_dsp_context_set_accel_flags(gavl_dsp_context_t * ctx,
    00287                                       int flags);
    00288
    00289
    00299 gavl_dsp_funcs_t *
    00300 gavl_dsp_context_get_funcs(gavl_dsp_context_t * ctx);
    00301
    00306 void gavl_dsp_context_destroy(gavl_dsp_context_t * ctx);
    00307
    00338 int gavl_dsp_interpolate_video_frame(gavl_dsp_context_t * ctx,
    00339                                       gavl_video_format_t * format,
    00340                                       gavl_video_frame_t * src_1,
    00341                                       gavl_video_frame_t * src_2,
    00342                                       gavl_video_frame_t * dst,
    00343                                       float factor);
    00344
    00357 int gavl_dsp_audio_frame_swap_endian(gavl_dsp_context_t * ctx,
    00358                                       gavl_audio_frame_t * frame,
    00359                                       const gavl_audio_format_t * format);
    00360
    00379 int gavl_dsp_video_frame_swap_endian(gavl_dsp_context_t * ctx,
    00380                                       gavl_video_frame_t * frame,
    00381                                       const gavl_video_format_t * format);
    00382
    00387 #endif // GAVLDSP_H_INCLUDED