00001 00002 /*! 00003 ************************************************************************ 00004 * \file refbuf.h 00005 * 00006 * \brief 00007 * Declarations of the reference frame buffer types and functions 00008 ************************************************************************ 00009 */ 00010 #ifndef _REBUF_H_ 00011 #define _REBUF_H_ 00012 00013 // global sub-pel image access variables 00014 extern int height_pad, width_pad; 00015 extern int height_pad_cr, width_pad_cr; 00016 00017 /*! 00018 ************************************************************************ 00019 * \brief 00020 * Yields a pel line _pointer_ from one of the 16 sub-images 00021 * Input does not require subpixel image indices 00022 ************************************************************************ 00023 */ 00024 static inline imgpel *UMVLine4X (imgpel ****Pic, int y, int x, int height, int width) 00025 { 00026 return &(Pic[(y & 0x03)][(x & 0x03)][iClip3( 0, height, y >> 2)][iClip3( 0, width, x >> 2)]); 00027 } 00028 00029 /*! 00030 ************************************************************************ 00031 * \brief 00032 * Yields a pel line _pointer_ from one of the 16 sub-images 00033 * Input does not require subpixel image indices 00034 ************************************************************************ 00035 */ 00036 static inline imgpel *FastLine4X (imgpel ****Pic, int y, int x) 00037 { 00038 return &(Pic[(y & 0x03)][(x & 0x03)][y >> 2][x >> 2]); 00039 } 00040 00041 /*! 00042 ************************************************************************ 00043 * \brief 00044 * Yields a pel line _pointer_ from one of the 16 (4:4:4), 32 (4:2:2), 00045 * or 64 (4:2:0) sub-images 00046 * Input does not require subpixel image indices 00047 ************************************************************************ 00048 */ 00049 static inline imgpel *UMVLine8X_chroma (imgpel ****Pic, int y, int x, int height, int width) 00050 { 00051 return &(Pic[y & chroma_mask_mv_y][x & chroma_mask_mv_x][iClip3 (0, height, y >> chroma_shift_y)][iClip3 (0, width , x >> chroma_shift_x)]); 00052 } 00053 00054 /*! 00055 ************************************************************************ 00056 * \brief 00057 * Yields a pel line _pointer_ from one of the 16 (4:4:4), 32 (4:2:2), 00058 * or 64 (4:2:0) sub-images 00059 * Input does not require subpixel image indices 00060 ************************************************************************ 00061 */ 00062 static inline imgpel *FastLine8X_chroma (imgpel ****Pic, int y, int x) 00063 { 00064 return &(Pic[y & chroma_mask_mv_y][x & chroma_mask_mv_x][y >> chroma_shift_y][x >> chroma_shift_x]); 00065 } 00066 00067 00068 #endif 00069