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 #pragma GCC visibility push(default)
00026 
00045 typedef struct gavl_dsp_context_s gavl_dsp_context_t;
00046 
00053 typedef struct
00054   {
00068   int (*sad_rgb15)(uint8_t * src_1, uint8_t * src_2, 
00069                    int stride_1, int stride_2, 
00070                    int w, int h);
00071 
00085   int (*sad_rgb16)(uint8_t * src_1, uint8_t * src_2, 
00086                    int stride_1, int stride_2, 
00087                    int w, int h);
00088 
00099   int (*sad_8)(uint8_t * src_1, uint8_t * src_2, 
00100                int stride_1, int stride_2, 
00101                int w, int h);
00102 
00113   int (*sad_16)(uint8_t * src_1, uint8_t * src_2, 
00114                int stride_1, int stride_2, 
00115                int w, int h);
00116 
00126   float (*sad_f)(uint8_t * src_1, uint8_t * src_2, 
00127                  int stride_1, int stride_2, 
00128                  int w, int h);
00129 
00137   void (*average_rgb15)(uint8_t * src_1, uint8_t * src_2, 
00138                         uint8_t * dst, int num);
00139 
00146   void (*average_rgb16)(uint8_t * src_1, uint8_t * src_2, 
00147                         uint8_t * dst, int num);
00148 
00155   void (*average_8)(uint8_t * src_1, uint8_t * src_2, 
00156                     uint8_t * dst, int num);
00157 
00164   void (*average_16)(uint8_t * src_1, uint8_t * src_2, 
00165                      uint8_t * dst, int num);
00166 
00174   void (*average_f)(uint8_t * src_1, uint8_t * src_2, 
00175                     uint8_t * dst, int num);
00176 
00177 
00188   void (*interpolate_rgb15)(uint8_t * src_1, uint8_t * src_2, 
00189                             uint8_t * dst, int num, float);
00190 
00200   void (*interpolate_rgb16)(uint8_t * src_1, uint8_t * src_2, 
00201                             uint8_t * dst, int num, float fac);
00202 
00212   void (*interpolate_8)(uint8_t * src_1, uint8_t * src_2, 
00213                         uint8_t * dst, int num, float fac);
00214 
00224   void (*interpolate_16)(uint8_t * src_1, uint8_t * src_2, 
00225                          uint8_t * dst, int num, float fac);
00226 
00237   void (*interpolate_f)(uint8_t * src_1, 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   
00258   } gavl_dsp_funcs_t;
00259 
00267 gavl_dsp_context_t * gavl_dsp_context_create();
00268 
00276 void gavl_dsp_context_set_quality(gavl_dsp_context_t * ctx,
00277                                   int q);
00278 
00287 void gavl_dsp_context_set_accel_flags(gavl_dsp_context_t * ctx,
00288                                       int flags);
00289 
00290 
00300 gavl_dsp_funcs_t * 
00301 gavl_dsp_context_get_funcs(gavl_dsp_context_t * ctx);
00302 
00307 void gavl_dsp_context_destroy(gavl_dsp_context_t * ctx);
00308 
00339 int gavl_dsp_interpolate_video_frame(gavl_dsp_context_t * ctx,
00340                                       gavl_video_format_t * format,
00341                                       gavl_video_frame_t * src_1,
00342                                       gavl_video_frame_t * src_2,
00343                                       gavl_video_frame_t * dst,
00344                                       float factor);
00345 
00358 int gavl_dsp_audio_frame_swap_endian(gavl_dsp_context_t * ctx,
00359                                       gavl_audio_frame_t * frame,
00360                                       const gavl_audio_format_t * format);
00361 
00380 int gavl_dsp_video_frame_swap_endian(gavl_dsp_context_t * ctx,
00381                                       gavl_video_frame_t * frame,
00382                                       const gavl_video_format_t * format);
00383 
00384 #pragma GCC visibility pop
00385 
00390 #endif // GAVLDSP_H_INCLUDED

Generated on Wed Apr 8 07:12:50 2009 for gavl by  doxygen 1.5.8