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 #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   
00258   } gavl_dsp_funcs_t;
00259 
00267 GAVL_PUBLIC
00268 gavl_dsp_context_t * gavl_dsp_context_create();
00269 
00277 GAVL_PUBLIC
00278 void gavl_dsp_context_set_quality(gavl_dsp_context_t * ctx,
00279                                   int q);
00280 
00289 GAVL_PUBLIC
00290 void gavl_dsp_context_set_accel_flags(gavl_dsp_context_t * ctx,
00291                                       int flags);
00292 
00293 
00303 GAVL_PUBLIC gavl_dsp_funcs_t * 
00304 gavl_dsp_context_get_funcs(gavl_dsp_context_t * ctx);
00305 
00310 GAVL_PUBLIC
00311 void gavl_dsp_context_destroy(gavl_dsp_context_t * ctx);
00312 
00343 GAVL_PUBLIC
00344 int gavl_dsp_interpolate_video_frame(gavl_dsp_context_t * ctx,
00345                                       gavl_video_format_t * format,
00346                                       gavl_video_frame_t * src_1,
00347                                       gavl_video_frame_t * src_2,
00348                                       gavl_video_frame_t * dst,
00349                                       float factor);
00350 
00363 GAVL_PUBLIC
00364 int gavl_dsp_audio_frame_swap_endian(gavl_dsp_context_t * ctx,
00365                                       gavl_audio_frame_t * frame,
00366                                       const gavl_audio_format_t * format);
00367 
00386 GAVL_PUBLIC
00387 int gavl_dsp_video_frame_swap_endian(gavl_dsp_context_t * ctx,
00388                                       gavl_video_frame_t * frame,
00389                                       const gavl_video_format_t * format);
00390 
00395 #endif // GAVLDSP_H_INCLUDED

Generated on Mon Jul 27 23:22:41 2009 for gavl by  doxygen 1.5.4