gavldsp.h
/*****************************************************************
* gavl - a general purpose audio/video processing library
*
* Copyright (c) 2001 - 2011 Members of the Gmerlin project
* gmerlin-general@lists.sourceforge.net
* http://gmerlin.sourceforge.net
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* *****************************************************************/
#ifndef GAVLDSP_H_INCLUDED
#define GAVLDSP_H_INCLUDED
#include <gavl/gavldefs.h>
typedef struct gavl_dsp_context_s gavl_dsp_context_t;
typedef struct
{
int (*sad_rgb15)(const uint8_t * src_1, const uint8_t * src_2,
int stride_1, int stride_2,
int w, int h);
int (*sad_rgb16)(const uint8_t * src_1, const uint8_t * src_2,
int stride_1, int stride_2,
int w, int h);
int (*sad_8)(const uint8_t * src_1, const uint8_t * src_2,
int stride_1, int stride_2,
int w, int h);
int (*sad_16)(const uint8_t * src_1, const uint8_t * src_2,
int stride_1, int stride_2,
int w, int h);
float (*sad_f)(const uint8_t * src_1, const uint8_t * src_2,
int stride_1, int stride_2,
int w, int h);
void (*average_rgb15)(const uint8_t * src_1, const uint8_t * src_2,
uint8_t * dst, int num);
void (*average_rgb16)(const uint8_t * src_1, const uint8_t * src_2,
uint8_t * dst, int num);
void (*average_8)(const uint8_t * src_1, const uint8_t * src_2,
uint8_t * dst, int num);
void (*average_16)(const uint8_t * src_1, const uint8_t * src_2,
uint8_t * dst, int num);
void (*average_f)(const uint8_t * src_1, const uint8_t * src_2,
uint8_t * dst, int num);
void (*interpolate_rgb15)(const uint8_t * src_1, const uint8_t * src_2,
uint8_t * dst, int num, float);
void (*interpolate_rgb16)(const uint8_t * src_1, const uint8_t * src_2,
uint8_t * dst, int num, float fac);
void (*interpolate_8)(const uint8_t * src_1, const uint8_t * src_2,
uint8_t * dst, int num, float fac);
void (*interpolate_16)(const uint8_t * src_1, const uint8_t * src_2,
uint8_t * dst, int num, float fac);
void (*interpolate_f)(const uint8_t * src_1, const uint8_t * src_2,
uint8_t * dst, int num, float fac);
void (*bswap_16)(void * ptr, int len);
void (*bswap_32)(void * ptr, int len);
void (*bswap_64)(void * ptr, int len);
void (*add_u8)(const void * src1, const void * src2, void * dst, int num);
void (*add_u8_s)(const void * src1, const void * src2, void * dst, int num);
void (*add_s8)(const void * src1, const void * src2, void * dst, int num);
void (*add_u16)(const void * src1, const void * src2, void * dst, int num);
void (*add_u16_s)(const void * src1, const void * src2, void * dst, int num);
void (*add_s16)(const void * src1, const void * src2, void * dst, int num);
void (*add_s32)(const void * src1, const void * src2, void * dst, int num);
void (*add_float)(const void * src1, const void * src2, void * dst, int num);
void (*add_double)(const void * src1, const void * src2, void * dst, int num);
void (*sub_u8)(const void * src1, const void * src2, void * dst, int num);
void (*sub_u8_s)(const void * src1, const void * src2, void * dst, int num);
void (*sub_s8)(const void * src1, const void * src2, void * dst, int num);
void (*sub_u16)(const void * src1, const void * src2, void * dst, int num);
void (*sub_u16_s)(const void * src1, const void * src2, void * dst, int num);
void (*sub_s16)(const void * src1, const void * src2, void * dst, int num);
void (*sub_s32)(const void * src1, const void * src2, void * dst, int num);
void (*sub_float)(const void * src1, const void * src2, void * dst, int num);
void (*sub_double)(const void * src1, const void * src2, void * dst, int num);
} gavl_dsp_funcs_t;
GAVL_PUBLIC
gavl_dsp_context_t * gavl_dsp_context_create();
GAVL_PUBLIC
void gavl_dsp_context_set_quality(gavl_dsp_context_t * ctx,
int q);
GAVL_PUBLIC
void gavl_dsp_context_set_accel_flags(gavl_dsp_context_t * ctx,
int flags);
GAVL_PUBLIC gavl_dsp_funcs_t *
gavl_dsp_context_get_funcs(gavl_dsp_context_t * ctx);
GAVL_PUBLIC
void gavl_dsp_context_destroy(gavl_dsp_context_t * ctx);
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);
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);
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);
#endif // GAVLDSP_H_INCLUDED
gavl_dsp_context_destroy
GAVL_PUBLIC void gavl_dsp_context_destroy(gavl_dsp_context_t *ctx)
Destroy a DSP context.
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_get_funcs
GAVL_PUBLIC gavl_dsp_funcs_t * gavl_dsp_context_get_funcs(gavl_dsp_context_t *ctx)
Get the functions.
gavl_dsp_context_create
GAVL_PUBLIC gavl_dsp_context_t * gavl_dsp_context_create()
Create 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_context_t
struct gavl_dsp_context_s gavl_dsp_context_t
Opaque DSP context.
Definition: gavldsp.h:45
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_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_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_audio_format_t
Audio Format.
Definition: gavl.h:261
gavl_audio_frame_t
Generic container for audio samples.
Definition: gavl.h:515
gavl_dsp_funcs_t
Function table.
Definition: gavldsp.h:54
gavl_video_format_s
Video format.
Definition: gavl.h:2120
gavl_video_frame_t
Definition: gavl.h:2285