michael@0: /* michael@0: * Copyright (c) 2010 The WebM project authors. All Rights Reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: michael@0: #ifndef common_h michael@0: #define common_h 1 michael@0: michael@0: #include michael@0: michael@0: /* Interface header for common constant data structures and lookup tables */ michael@0: michael@0: #include "vpx_mem/vpx_mem.h" michael@0: michael@0: /* Only need this for fixed-size arrays, for structs just assign. */ michael@0: michael@0: #define vp8_copy( Dest, Src) { \ michael@0: assert( sizeof( Dest) == sizeof( Src)); \ michael@0: vpx_memcpy( Dest, Src, sizeof( Src)); \ michael@0: } michael@0: michael@0: /* Use this for variably-sized arrays. */ michael@0: michael@0: #define vp8_copy_array( Dest, Src, N) { \ michael@0: assert( sizeof( *Dest) == sizeof( *Src)); \ michael@0: vpx_memcpy( Dest, Src, N * sizeof( *Src)); \ michael@0: } michael@0: michael@0: #define vp8_zero( Dest) vpx_memset( &Dest, 0, sizeof( Dest)); michael@0: michael@0: #define vp8_zero_array( Dest, N) vpx_memset( Dest, 0, N * sizeof( *Dest)); michael@0: michael@0: michael@0: #endif /* common_h */