h263plus.h
Upload User: zhongxx05
Upload Date: 2007-06-06
Package Size: 33641k
Code Size: 5k
Category:

Symbian

Development Platform:

C/C++

  1. /* ***** BEGIN LICENSE BLOCK ***** 
  2.  * Version: RCSL 1.0/RPSL 1.0 
  3.  *  
  4.  * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
  5.  *      
  6.  * The contents of this file, and the files included with this file, are 
  7.  * subject to the current version of the RealNetworks Public Source License 
  8.  * Version 1.0 (the "RPSL") available at 
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed 
  10.  * the file under the RealNetworks Community Source License Version 1.0 
  11.  * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
  12.  * in which case the RCSL will apply. You may also obtain the license terms 
  13.  * directly from RealNetworks.  You may not use this file except in 
  14.  * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
  15.  * applicable to this file, the RCSL.  Please see the applicable RPSL or 
  16.  * RCSL for the rights, obligations and limitations governing use of the 
  17.  * contents of the file.  
  18.  *  
  19.  * This file is part of the Helix DNA Technology. RealNetworks is the 
  20.  * developer of the Original Code and owns the copyrights in the portions 
  21.  * it created. 
  22.  *  
  23.  * This file, and the files included with this file, is distributed and made 
  24.  * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
  25.  * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
  26.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
  27.  * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
  28.  * 
  29.  * Technology Compatibility Kit Test Suite(s) Location: 
  30.  *    http://www.helixcommunity.org/content/tck 
  31.  * 
  32.  * Contributor(s): 
  33.  *  
  34.  * ***** END LICENSE BLOCK ***** */ 
  35. #ifndef _H263PLUS_H_
  36. #define _H263PLUS_H_
  37. #ifdef _MACINTOSH
  38. #ifdef DO_H263_PLUS
  39. #undef DO_H263_PLUS
  40. #endif
  41. #endif
  42. #define DO_H263_PLUS
  43. #ifdef DO_H263_PLUS
  44. extern int ireorder[8];
  45. extern int inv_alt_hor_scan[64];
  46. extern int inv_alt_hor_scan_no_reorder[64];
  47. extern int alt_hor_to_zigzag[64];
  48. extern int inv_alt_ver_scan[64];
  49. extern int inv_alt_ver_scan_no_reorder[64];
  50. extern int alt_ver_to_zigzag[64];
  51. extern int zigzag_to_zigzag[64];
  52. // some predicates for B frames
  53. #define BFRAME_IS_BIDIRECTIONAL(x)  ((x)->modB == 0 || (x)->modB == 3)
  54. #define BFRAME_IS_FORWARD(x) ((x)->modB == 1 || (x)->modB == 2)
  55. #define BFRAME_HAS_CBP(x) ((x)->modB >= 2)
  56. #define BFRAME_HAS_BLOCKS(x) BFRAME_HAS_CBP(x)
  57. #define BFRAME_HAS_MOTION_VECTOR(x) ((x)->modB == 1 || (x)->modB == 2)
  58. #define H263PLUS_IMPROVED_PBFRAME_MODE (2)
  59. #define H263_ORIGINAL_PBFRAME_MODE (1)
  60. // Bitflags for the EPTYPE codeword
  61. #define EPTYPE263PLUS_ADVANCED_INTRA_MODE    (0x400)
  62. #define EPTYPE263PLUS_DEBLOCKING_FILTER_MODE (0x200)
  63. #define EPTYPE263PLUS_IMPROVED_PBFRAME_MODE (0x10)
  64. #define EPTYPE263PLUS_REDUCED_RES_UPDATE    (0x4)
  65. #define H263PLUS_EXTENSIONS_USED(d) ((d)->PBframeMode==H263PLUS_IMPROVED_PBFRAME_MODE || 
  66.    (d)->deblockingFilterMode || (d)->advancedIntraMode || (d)->reducedResUpdate)
  67. #define ROUNDDIV2(n)    (((n) + 1) >> 1)    /* Divide by 2 and round up */
  68. #define ADV_INTRA_PRED_DC_ONLY (0)
  69. #define ADV_INTRA_PRED_COLUMN (1)
  70. #define ADV_INTRA_PRED_ROW (2)
  71. #define ADV_INTRA_PRED_NONE (3)
  72. void ApplyDeblockingFilter( PICTURE * pic, MACROBLOCK_DESCR * mb, S32 Bframe);
  73. extern void ReducedResDeblockingFilter( PICTURE * pic, MACROBLOCK_DESCR * mb );
  74. void Idct2AdvancedIntra( SYMBOL sym[], int nsym, PIXEL x[], int xdim, S16 recon[],
  75.                 U8 rDCpred, S8 rACpred[8], U8 rDCstore[1], S8 rACstore[8], 
  76.                 U8 cDCpred, S8 cACpred[8], U8 cDCstore[1], S8 cACstore[8],
  77.                 int predtype, int fixedDC, int leftBoundary, int upperBoundary);
  78. void ReconAdvancedIntra( MACROBLOCK_DESCR * mb, PICTURE * pic, int clean);
  79. U8 pred_select_advanced_intra( S16 y[4][64], S8 rACpred0[8], S8 rACpred1[8],S8 cACpred0[8], 
  80.                           S8 cACpred2[8],pQMatrix qtab);
  81. U8 pred_select_advanced_intra_full_search( S16 y[6][64], 
  82.                           U8 rDCpred0, S8 rACpred0[8], U8 rDCpred1, S8 rACpred1[8],
  83.                           U8 rDCpredCb, S8 rACpredCb[8], U8 rDCpredCr, S8 rACpredCr[8],
  84.                           U8 cDCpred0, S8 cACpred0[8], U8 cDCpred2, S8 cACpred2[8], 
  85.                           U8 cDCpredCb, S8 cACpredCb[8], U8 cDCpredCr, S8 cACpredCr[8],
  86.                           pQMatrix qtab, int ncoeffs, int fixedDC,
  87.                           int leftBoundary, int upperBoundary);
  88. int quant_advanced_intra( S16 y[64], 
  89.                           U8 rDCpred, S8 rACpred[8], U8 rDCstore[1], S8 rACstore[8], 
  90.                           U8 cDCpred, S8 cACpred[8], U8 cDCstore[1], S8 cACstore[8],
  91.                           pQMatrix qtab, int ncoeffs, SYMBOL sym[], int predtype, int fixedDC,
  92.                           int leftBoundary, int upperBoundary);
  93. int AdvancedIntraCode( PICTURE *pic, MACROBLOCK_DESCR * mb, SYMBOL sym[], long mbDiff,
  94.                       int codingMethod );
  95. void InitAdvancedIntraTables();
  96. #else
  97. // These are for original H.263 B frames
  98. #define BFRAME_IS_BIDIRECTIONAL(x)  (TRUE)
  99. #define BFRAME_IS_FORWARD(x) (FALSE)
  100. #define BFRAME_HAS_CBP(x) ((x)->modB >= 2)
  101. #define BFRAME_HAS_BLOCKS(x) BFRAME_HAS_CBP(x)
  102. #define BFRAME_HAS_MOTION_VECTOR(x) ((x)->modB != 0)
  103. #endif
  104. #endif