1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 /* 19 * File: crccheck_cpp.h 20 * Author: RussellHayashida (rhayashida@packetvideo.com) 21 * Date: February 13, 2002 22 * Comment: crc check function declarations 23 */ 24 25 #ifndef _CRCCHECK_CPP_H 26 #define _CRCCHECK_CPP_H 27 28 #include "oscl_base.h" 29 #include "media_packet.h" 30 #include "pvmf_media_data_impl.h" 31 #define NO_ERR 0 32 #define CRC_ERR 1 33 #define SN_ERR 2 34 35 class CRC 36 { 37 public: 38 OSCL_IMPORT_REF CRC(); ~CRC()39 ~CRC() {}; 40 OSCL_IMPORT_REF uint8 Crc8Check(uint8 *pData, int16 Size); 41 OSCL_IMPORT_REF uint8 Crc8Check(Packet *pPkt); 42 OSCL_IMPORT_REF uint8 Crc8Check(OsclSharedPtr<PVMFMediaDataImpl>& mediaData, bool hasCRC = false); 43 44 OSCL_IMPORT_REF uint16 Crc16Check(uint8 *pData, int16 Size); 45 OSCL_IMPORT_REF uint16 Crc16Check(Packet *pPkt); 46 OSCL_IMPORT_REF uint16 Crc16Check(OsclSharedPtr<PVMFMediaDataImpl>& mediaData, bool hasCRC = false); 47 48 uint16 CrcTbl8[256]; 49 uint16 CrcTbl16[256]; 50 }; 51 52 #endif /* _CRCCHECK_H */ 53