gavl
gavldsp.h
1 /*****************************************************************
2  * gavl - a general purpose audio/video processing library
3  *
4  * Copyright (c) 2001 - 2012 Members of the Gmerlin project
5  * gmerlin-general@lists.sourceforge.net
6  * http://gmerlin.sourceforge.net
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  * *****************************************************************/
21 
22 #ifndef GAVLDSP_H_INCLUDED
23 #define GAVLDSP_H_INCLUDED
24 
25 #include <gavl/gavldefs.h>
26 
45 typedef struct gavl_dsp_context_s gavl_dsp_context_t;
46 
53 typedef struct
54  {
68  int (*sad_rgb15)(const uint8_t * src_1, const uint8_t * src_2,
69  int stride_1, int stride_2,
70  int w, int h);
71 
85  int (*sad_rgb16)(const uint8_t * src_1, const uint8_t * src_2,
86  int stride_1, int stride_2,
87  int w, int h);
88 
99  int (*sad_8)(const uint8_t * src_1, const uint8_t * src_2,
100  int stride_1, int stride_2,
101  int w, int h);
102 
113  int (*sad_16)(const uint8_t * src_1, const uint8_t * src_2,
114  int stride_1, int stride_2,
115  int w, int h);
116 
126  float (*sad_f)(const uint8_t * src_1, const uint8_t * src_2,
127  int stride_1, int stride_2,
128  int w, int h);
129 
137  void (*average_rgb15)(const uint8_t * src_1, const uint8_t * src_2,
138  uint8_t * dst, int num);
139 
146  void (*average_rgb16)(const uint8_t * src_1, const uint8_t * src_2,
147  uint8_t * dst, int num);
148 
155  void (*average_8)(const uint8_t * src_1, const uint8_t * src_2,
156  uint8_t * dst, int num);
157 
164  void (*average_16)(const uint8_t * src_1, const uint8_t * src_2,
165  uint8_t * dst, int num);
166 
174  void (*average_f)(const uint8_t * src_1, const uint8_t * src_2,
175  uint8_t * dst, int num);
176 
177 
188  void (*interpolate_rgb15)(const uint8_t * src_1, const uint8_t * src_2,
189  uint8_t * dst, int num, float);
190 
200  void (*interpolate_rgb16)(const uint8_t * src_1, const uint8_t * src_2,
201  uint8_t * dst, int num, float fac);
202 
212  void (*interpolate_8)(const uint8_t * src_1, const uint8_t * src_2,
213  uint8_t * dst, int num, float fac);
214 
224  void (*interpolate_16)(const uint8_t * src_1, const uint8_t * src_2,
225  uint8_t * dst, int num, float fac);
226 
237  void (*interpolate_f)(const uint8_t * src_1, const uint8_t * src_2,
238  uint8_t * dst, int num, float fac);
239 
244  void (*bswap_16)(void * ptr, int len);
245 
250  void (*bswap_32)(void * ptr, int len);
251 
256  void (*bswap_64)(void * ptr, int len);
257 
267  void (*add_u8)(const void * src1, const void * src2, void * dst, int num);
268 
277  void (*add_u8_s)(const void * src1, const void * src2, void * dst, int num);
278 
287  void (*add_s8)(const void * src1, const void * src2, void * dst, int num);
288 
297  void (*add_u16)(const void * src1, const void * src2, void * dst, int num);
298 
307  void (*add_u16_s)(const void * src1, const void * src2, void * dst, int num);
308 
317  void (*add_s16)(const void * src1, const void * src2, void * dst, int num);
318 
327  void (*add_s32)(const void * src1, const void * src2, void * dst, int num);
328 
337  void (*add_float)(const void * src1, const void * src2, void * dst, int num);
338 
347  void (*add_double)(const void * src1, const void * src2, void * dst, int num);
348 
358  void (*sub_u8)(const void * src1, const void * src2, void * dst, int num);
359 
368  void (*sub_u8_s)(const void * src1, const void * src2, void * dst, int num);
369 
378  void (*sub_s8)(const void * src1, const void * src2, void * dst, int num);
379 
388  void (*sub_u16)(const void * src1, const void * src2, void * dst, int num);
389 
398  void (*sub_u16_s)(const void * src1, const void * src2, void * dst, int num);
399 
408  void (*sub_s16)(const void * src1, const void * src2, void * dst, int num);
409 
418  void (*sub_s32)(const void * src1, const void * src2, void * dst, int num);
419 
428  void (*sub_float)(const void * src1, const void * src2, void * dst, int num);
429 
438  void (*sub_double)(const void * src1, const void * src2, void * dst, int num);
439 
445  void (*shift_up_16)(void * ptr, int num, int bits);
446 
452  void (*shift_down_16)(void * ptr, int num, int bits);
453 
455 
463 GAVL_PUBLIC
465 
473 GAVL_PUBLIC
475  int q);
476 
485 GAVL_PUBLIC
487  int flags);
488 
489 
499 GAVL_PUBLIC gavl_dsp_funcs_t *
501 
506 GAVL_PUBLIC
508 
539 GAVL_PUBLIC
541  gavl_video_format_t * format,
542  gavl_video_frame_t * src_1,
543  gavl_video_frame_t * src_2,
544  gavl_video_frame_t * dst,
545  float factor);
546 
559 GAVL_PUBLIC
561  gavl_audio_frame_t * frame,
562  const gavl_audio_format_t * format);
563 
582 GAVL_PUBLIC
584  gavl_video_frame_t * frame,
585  const gavl_video_format_t * format);
586 
602 void
604  gavl_video_frame_t * frame,
605  const gavl_video_format_t * format, int bits);
606 
607 
612 #endif // GAVLDSP_H_INCLUDED