gavl
gavldsp.h
1 /*****************************************************************
2  * gavl - a general purpose audio/video processing library
3  *
4  * Copyright (c) 2001 - 2011 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 
440 
442 
450 GAVL_PUBLIC
452 
460 GAVL_PUBLIC
462  int q);
463 
472 GAVL_PUBLIC
474  int flags);
475 
476 
486 GAVL_PUBLIC gavl_dsp_funcs_t *
488 
493 GAVL_PUBLIC
495 
526 GAVL_PUBLIC
528  gavl_video_format_t * format,
529  gavl_video_frame_t * src_1,
530  gavl_video_frame_t * src_2,
531  gavl_video_frame_t * dst,
532  float factor);
533 
546 GAVL_PUBLIC
548  gavl_audio_frame_t * frame,
549  const gavl_audio_format_t * format);
550 
569 GAVL_PUBLIC
571  gavl_video_frame_t * frame,
572  const gavl_video_format_t * format);
573 
578 #endif // GAVLDSP_H_INCLUDED
gavl_dsp_context_t
struct gavl_dsp_context_s gavl_dsp_context_t
Opaque DSP context.
Definition: gavldsp.h:45
gavl_dsp_audio_frame_swap_endian
GAVL_PUBLIC int gavl_dsp_audio_frame_swap_endian(gavl_dsp_context_t *ctx, gavl_audio_frame_t *frame, const gavl_audio_format_t *format)
Swap endianess an audio frame.
gavl_dsp_context_destroy
GAVL_PUBLIC void gavl_dsp_context_destroy(gavl_dsp_context_t *ctx)
Destroy a DSP context.
gavl_dsp_context_set_accel_flags
GAVL_PUBLIC void gavl_dsp_context_set_accel_flags(gavl_dsp_context_t *ctx, int flags)
Set the acceleration flags for a DSP context.
gavl_dsp_interpolate_video_frame
GAVL_PUBLIC int gavl_dsp_interpolate_video_frame(gavl_dsp_context_t *ctx, gavl_video_format_t *format, gavl_video_frame_t *src_1, gavl_video_frame_t *src_2, gavl_video_frame_t *dst, float factor)
Do a linear interpolation of a video frame.
gavl_dsp_funcs_t
Function table.
Definition: gavldsp.h:54
gavl_dsp_context_get_funcs
GAVL_PUBLIC gavl_dsp_funcs_t * gavl_dsp_context_get_funcs(gavl_dsp_context_t *ctx)
Get the functions.
gavl_audio_format_t
Audio Format.
Definition: gavl.h:261
gavl_dsp_video_frame_swap_endian
GAVL_PUBLIC int gavl_dsp_video_frame_swap_endian(gavl_dsp_context_t *ctx, gavl_video_frame_t *frame, const gavl_video_format_t *format)
Swap endianess a video frame.
gavl_video_format_s
Video format.
Definition: gavl.h:2120
gavl_dsp_context_set_quality
GAVL_PUBLIC void gavl_dsp_context_set_quality(gavl_dsp_context_t *ctx, int q)
Set the quality for a DSP context.
gavl_dsp_context_create
GAVL_PUBLIC gavl_dsp_context_t * gavl_dsp_context_create()
Create a DSP context.
gavl_audio_frame_t
Generic container for audio samples.
Definition: gavl.h:515
gavl_video_frame_t
Definition: gavl.h:2285