home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 275 / DPCS0111DVD.ISO / Toolkit / Audio-Visual / VirtualDub / Source / VirtualDub-1.9.10-src.7z / src / Meia / source / tables.cpp < prev   
Encoding:
C/C++ Source or Header  |  2009-09-14  |  1.5 KB  |  51 lines

  1. #include "tables.h"
  2.  
  3. namespace nsVDMPEGTables {
  4.     // red:        [-223, 481]
  5.     // green:    [-172, 432]
  6.     // blue:    [-277, 534]
  7.     //
  8.     // So we need a clip table: [-277, 534].  Let's make it [-288, 543].
  9.     //
  10.     //    This is why Java sucks: it doesn't have a preprocessor.
  11.  
  12.     #define CLIP_TABLE_16R(v) v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v
  13.     #define CLIP_TABLE_64R(v) CLIP_TABLE_16R(v),CLIP_TABLE_16R(v),CLIP_TABLE_16R(v),CLIP_TABLE_16R(v)
  14.     #define CLIP_TABLE_16U(x) (x+0),(x+1),(x+2),(x+3),(x+4),(x+5),(x+6),(x+7),(x+8),(x+9),(x+10),(x+11),(x+12),(x+13),(x+14),(x+15)
  15.  
  16.     const unsigned char clip_table[832]={
  17.         CLIP_TABLE_16R(0),        //    [-288, -273]
  18.         CLIP_TABLE_16R(0),        //    [-272, -257]
  19.         CLIP_TABLE_64R(0),        //    [-256, -193]
  20.         CLIP_TABLE_64R(0),        //    [-192, -129]
  21.         CLIP_TABLE_64R(0),        //    [-128,  -65]
  22.         CLIP_TABLE_64R(0),        //    [- 64,   -1]
  23.         CLIP_TABLE_16U(0x00),
  24.         CLIP_TABLE_16U(0x10),
  25.         CLIP_TABLE_16U(0x20),
  26.         CLIP_TABLE_16U(0x30),
  27.         CLIP_TABLE_16U(0x40),
  28.         CLIP_TABLE_16U(0x50),
  29.         CLIP_TABLE_16U(0x60),
  30.         CLIP_TABLE_16U(0x70),
  31.         CLIP_TABLE_16U(0x80),
  32.         CLIP_TABLE_16U(0x90),
  33.         CLIP_TABLE_16U(0xA0),
  34.         CLIP_TABLE_16U(0xB0),
  35.         CLIP_TABLE_16U(0xC0),
  36.         CLIP_TABLE_16U(0xD0),
  37.         CLIP_TABLE_16U(0xE0),
  38.         CLIP_TABLE_16U(0xF0),
  39.         CLIP_TABLE_64R(255),    //    [256, 319]
  40.         CLIP_TABLE_64R(255),    //    [320, 383]
  41.         CLIP_TABLE_64R(255),    //    [384, 447]
  42.         CLIP_TABLE_64R(255),    //    [448, 511]
  43.         CLIP_TABLE_16R(255),    //    [512, 527]
  44.         CLIP_TABLE_16R(255),    //    [528, 543]
  45.     };
  46.  
  47.     #undef CLIP_TABLE_16R
  48.     #undef CLIP_TABLE_64R
  49.     #undef CLIP_TABLE_16U
  50. };
  51.