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

Audio

开发平台:

Visual C++

  1. /*****************************************************************************
  2.  * predict.h: h264 encoder library
  3.  *****************************************************************************
  4.  * Copyright (C) 2003 Laurent Aimar
  5.  * $Id: predict.h,v 1.1 2004/06/03 19:27:07 fenrir Exp $
  6.  *
  7.  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  *
  14.  * This program is distributed in the hope that it will be useful,
  15.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  * GNU General Public License for more details.
  18.  *
  19.  * You should have received a copy of the GNU General Public License
  20.  * along with this program; if not, write to the Free Software
  21.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  22.  *****************************************************************************/
  23. #ifndef _PREDICT_H
  24. #define _PREDICT_H 1
  25. typedef void (*x264_predict_t)( uint8_t *src );
  26. typedef void (*x264_predict8x8_t)( uint8_t *src, int i_neighbor );
  27. enum intra_chroma_pred_e
  28. {
  29.     I_PRED_CHROMA_DC = 0,
  30.     I_PRED_CHROMA_H  = 1,
  31.     I_PRED_CHROMA_V  = 2,
  32.     I_PRED_CHROMA_P  = 3,
  33.     I_PRED_CHROMA_DC_LEFT = 4,
  34.     I_PRED_CHROMA_DC_TOP  = 5,
  35.     I_PRED_CHROMA_DC_128  = 6
  36. };
  37. static const int x264_mb_pred_mode8x8c_fix[7] =
  38. {
  39.     I_PRED_CHROMA_DC, I_PRED_CHROMA_H, I_PRED_CHROMA_V, I_PRED_CHROMA_P,
  40.     I_PRED_CHROMA_DC, I_PRED_CHROMA_DC,I_PRED_CHROMA_DC
  41. };
  42. enum intra16x16_pred_e
  43. {
  44.     I_PRED_16x16_V  = 0,
  45.     I_PRED_16x16_H  = 1,
  46.     I_PRED_16x16_DC = 2,
  47.     I_PRED_16x16_P  = 3,
  48.     I_PRED_16x16_DC_LEFT = 4,
  49.     I_PRED_16x16_DC_TOP  = 5,
  50.     I_PRED_16x16_DC_128  = 6,
  51. };
  52. static const int x264_mb_pred_mode16x16_fix[7] =
  53. {
  54.     I_PRED_16x16_V, I_PRED_16x16_H, I_PRED_16x16_DC, I_PRED_16x16_P,
  55.     I_PRED_16x16_DC,I_PRED_16x16_DC,I_PRED_16x16_DC
  56. };
  57. enum intra4x4_pred_e
  58. {
  59.     I_PRED_4x4_V  = 0,
  60.     I_PRED_4x4_H  = 1,
  61.     I_PRED_4x4_DC = 2,
  62.     I_PRED_4x4_DDL= 3,
  63.     I_PRED_4x4_DDR= 4,
  64.     I_PRED_4x4_VR = 5,
  65.     I_PRED_4x4_HD = 6,
  66.     I_PRED_4x4_VL = 7,
  67.     I_PRED_4x4_HU = 8,
  68.     I_PRED_4x4_DC_LEFT = 9,
  69.     I_PRED_4x4_DC_TOP  = 10,
  70.     I_PRED_4x4_DC_128  = 11,
  71. };
  72. static const int x264_mb_pred_mode4x4_fix[13] =
  73. {
  74.     -1,
  75.     I_PRED_4x4_V,   I_PRED_4x4_H,   I_PRED_4x4_DC,
  76.     I_PRED_4x4_DDL, I_PRED_4x4_DDR, I_PRED_4x4_VR,
  77.     I_PRED_4x4_HD,  I_PRED_4x4_VL,  I_PRED_4x4_HU,
  78.     I_PRED_4x4_DC,  I_PRED_4x4_DC,  I_PRED_4x4_DC
  79. };
  80. #define x264_mb_pred_mode4x4_fix(t) x264_mb_pred_mode4x4_fix[(t)+1]
  81. /* must use the same numbering as intra4x4_pred_e */
  82. enum intra8x8_pred_e
  83. {
  84.     I_PRED_8x8_V  = 0,
  85.     I_PRED_8x8_H  = 1,
  86.     I_PRED_8x8_DC = 2,
  87.     I_PRED_8x8_DDL= 3,
  88.     I_PRED_8x8_DDR= 4,
  89.     I_PRED_8x8_VR = 5,
  90.     I_PRED_8x8_HD = 6,
  91.     I_PRED_8x8_VL = 7,
  92.     I_PRED_8x8_HU = 8,
  93.     I_PRED_8x8_DC_LEFT = 9,
  94.     I_PRED_8x8_DC_TOP  = 10,
  95.     I_PRED_8x8_DC_128  = 11,
  96. };
  97. void x264_predict_16x16_init ( int cpu, x264_predict_t pf[7] );
  98. void x264_predict_8x8c_init  ( int cpu, x264_predict_t pf[7] );
  99. void x264_predict_4x4_init   ( int cpu, x264_predict_t pf[12] );
  100. void x264_predict_8x8_init   ( int cpu, x264_predict8x8_t pf[12] );
  101. #endif