X-Git-Url: http://git.maemo.org/git/?p=mardrone;a=blobdiff_plain;f=mardrone%2FARDrone_SDK_Version_1_8_20110726%2FARDroneLib%2FVLIB%2FPlatform%2Farm9%2Fvideo_gen_sad.h;fp=mardrone%2FARDrone_SDK_Version_1_8_20110726%2FARDroneLib%2FVLIB%2FPlatform%2Farm9%2Fvideo_gen_sad.h;h=226ce8524cb5c44e8a214651dfee8bbbf40ac025;hp=0000000000000000000000000000000000000000;hb=9ec9bc13b75d30bc45535c54a652934debfcea92;hpb=ae0a3c2dc0898400aca0dd6b439c5db8044db7b2 diff --git a/mardrone/ARDrone_SDK_Version_1_8_20110726/ARDroneLib/VLIB/Platform/arm9/video_gen_sad.h b/mardrone/ARDrone_SDK_Version_1_8_20110726/ARDroneLib/VLIB/Platform/arm9/video_gen_sad.h new file mode 100644 index 0000000..226ce85 --- /dev/null +++ b/mardrone/ARDrone_SDK_Version_1_8_20110726/ARDroneLib/VLIB/Platform/arm9/video_gen_sad.h @@ -0,0 +1,46 @@ +#ifndef _VIDEO_GEN_SAD_H_ +#define _VIDEO_GEN_SAD_H_ + +// Returns the sum of absolute difference between reference and source +typedef uint32_t (*sad_fn)(void* ref, void* src); + +// +// bytes1 : number of bytes for ref (1-bytes) +// offset_ref : number of elements to skip to process next row ( 176 in QCIF for example, or at least row_length for a contiguous array ) +// square_length : number of elements per row or column +// offset_ref & offset_src must be less than 1024 +// +sad_fn gen_sad( uint32_t* buffer, uint32_t buffer_length, + uint32_t bytes_per_entry_ref, uint32_t bytes_per_entry_src, + uint16_t offset_ref, uint16_t offset_src, + uint32_t square_length); + +/* + Usage: + +int32_t sad_ref[] = { 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8 }; + +int16_t sad_mem[] = { 9, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 12, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8, + 1, 2, 3, 4, 5, 6, 7, 8 }; + + uint32_t ramcode_buffer_sad[256]; + sad_fn sad_8_32_16 = gen_sad( ramcode_buffer_sad, 256, MEM_FMT_32, MEM_FMT_16, 8, 8, 8); + + uint32_t sum = sad_8_32_16(sad_ref, sad_mem); +*/ + + +#endif // _VIDEO_GENSAD_H_