refbuf.c
上传用户:hjq518
上传日期:2021-12-09
资源大小:5084k
文件大小:2k
源码类别:

Audio

开发平台:

Visual C++

  1. /*!
  2.  ************************************************************************
  3.  * file refbuf.c
  4.  *
  5.  * brief
  6.  *    Declarations of the reference frame buffer types and functions
  7.  ************************************************************************
  8.  */
  9. #include "global.h"
  10. #include "refbuf.h"
  11. /*!
  12.  ************************************************************************
  13.  * brief
  14.  *    Yields a pel line _pointer_ from one of the 16 sub-images
  15.  *    Input does not require subpixel image indices
  16.  ************************************************************************
  17.  */
  18. imgpel *FastLine4X (imgpel ****Pic, int y, int x)
  19. {
  20.   return &(Pic[(y & 0x03)][(x & 0x03)][y >> 2][x >> 2]);
  21. }
  22. /*!
  23.  ************************************************************************
  24.  * brief
  25.  *    Yields a pel line _pointer_ from one of the 16 sub-images
  26.  *    Input does not require subpixel image indices
  27.  ************************************************************************
  28.  */
  29. imgpel *UMVLine4X (imgpel ****Pic, int y, int x)
  30. {
  31.   return &(Pic[(y & 0x03)][(x & 0x03)][iClip3( 0, height_pad, y >> 2)][iClip3( 0, width_pad , x >> 2)]);
  32. }
  33. /*!
  34.  ************************************************************************
  35.  * brief
  36.  *    Yields a pel line _pointer_ from one of the 16 (4:4:4), 32 (4:2:2),
  37.  *    or 64 (4:2:0) sub-images
  38.  *    Input does not require subpixel image indices
  39.  ************************************************************************
  40.  */
  41. imgpel *UMVLine8X_chroma (imgpel ****Pic, int y, int x)
  42. {
  43.   return &(Pic[y & chroma_mask_mv_y][x & chroma_mask_mv_x][iClip3 (0, height_pad_cr, y >> chroma_shift_y)][iClip3 (0, width_pad_cr , x >> chroma_shift_x)]);
  44. }
  45. /*!
  46.  ************************************************************************
  47.  * brief
  48.  *    Yields a pel line _pointer_ from one of the 16 (4:4:4), 32 (4:2:2),
  49.  *    or 64 (4:2:0) sub-images
  50.  *    Input does not require subpixel image indices
  51.  ************************************************************************
  52.  */
  53. imgpel *FastLine8X_chroma (imgpel ****Pic, int y, int x)
  54. {
  55.   return &(Pic[y & chroma_mask_mv_y][x & chroma_mask_mv_x][y >> chroma_shift_y][x >> chroma_shift_x]);
  56. }