Camstream: CamStream API documentation

Main Page Class Hierarchy Compound List File List Compound Members File Members

# video_asm.h

Go to the documentation of this file.

    00001 #ifndef VIDEO_ASM_H
    00002 #define VIDEO_ASM_H
    00003
    00004 /* interface to C */
    00005
    00006 #ifdef __cplusplus
    00007 extern "C" {
    00008 #endif
    00009
    00010 /* Fast assambly routines for common operations on video: adding
    00011    buffers, substracting, taking diffs, etc.
    00012    All operations are performed bytewise, the void * are just used
    00013    to keep the compiler happy.
    00014
    00015    The functions ending in '_mmx' use MMX instructions, acting on 4 or even
    00016    8 bytes at a time. It follows that 'n' should be a multiple of 8. The
    00017    '_smx' function use the Saturated version of the MMX instructions.
    00018
    00019    Definitions:
    00020    'diff': c = (a - b) / 2
    00021    'intg': c += (a * 2);
    00022
    00023    'add': a += b
    00024    'plus': c = a + b
    00025    'sub': a -= b
    00026    'minus': c = a - b
    00027
    00028    The '128' version of the functions assume the data in the buffers has a
    00029    virtual null point at 128, and compensate for this.
    00030  */
    00031
    00032 void calc_diff128    (int n, void *dst, void *src_new, void *src_old);
    00033 void calc_diff128_mmx(int n, void *dst, void *src_new, void *src_old);
    00034
    00035 void calc_intg128    (int n, void *dst, void *delta);
    00036 void calc_intg128_smx(int n, void *dst, void *delta);
    00037
    00038 /* Basic operators */
    00039 /* Add 'src' to 'dst' */
    00040 void calc_add    (int n, void *dst, void *src);
    00041 void calc_add_mmx(int n, void *dst, void *src);
    00042 void calc_add_smx(int n, void *dst, void *src);
    00043
    00044 /* Add 'src' to 'dst', with offset 128 */
    00045 void calc_add128_mmx(int n, void *dst, void *src);
    00046
    00047 /* Add 'src1' to 'src2', storing the result in 'dst' */
    00048 void calc_plus    (int n, void *dst, void *src1, void *src2);
    00049 void calc_plus_mmx(int n, void *dst, void *src1, void *src2);
    00050 void calc_plus_smx(int n, void *dst, void *src1, void *src2);
    00051
    00052 #ifdef __cplusplus
    00053 }
    00054 #endif
    00055
    00056 #endif