TVGHI.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:1k
源码类别:

DVD

开发平台:

Others

  1. #include "Config.h" // Global Configuration - do not remove!
  2. #ifdef TV_GUARDIAN_ENABLE
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <string.h>
  6. #include "Playcoretvgtvghi.h"
  7. #include "Playcoretvgtvg.h"
  8. #include "Playcoretvgtvgcode.h"
  9. #include "Playcoretvgtvgram.h"
  10. #include "Playcoretvgtvgpar.h"
  11. uchar tvg_process_gop( uchar *ccdata, uchar *ccdata_out, uchar index, uchar gop_length ) {
  12.   uchar c1,c2, errcnt, i;
  13.   errcnt=0;
  14.   gop_offset = index;
  15. //  index *= 2; 
  16. //  ccin  = ccdata + index;
  17. //  ccout = ccdata_out + index;
  18.   if(index==0) { // lets check this whole block
  19.     for(i=0;i<(gop_length << 1);i+=2) {
  20.       c1=ccdata[i+0] & 0x7F;
  21.       c2=ccdata[i+1] & 0x7F;
  22.       if(ccdata[i+0] != mkpar[c1]) errcnt++; // parity err
  23.       if(ccdata[i+1] != mkpar[c2]) errcnt++; // parity err
  24.     }
  25.     if(errcnt > ERR_THRESHOLD) {
  26.       tvg_flags |= FORCE_NULLS;
  27.     } else {
  28.       tvg_flags &= ~FORCE_NULLS;
  29.     }
  30.   }
  31.   tvg_process( ccdata,  ccdata_out, 1 );
  32.   return errcnt;
  33. }
  34. #endif //TV_GUARDIAN_ENABLE