atsci_syminfo.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _ATSC_SYMINFO_H_
00023 #define _ATSC_SYMINFO_H_
00024
00025 namespace atsc {
00026
00027 static const unsigned int SI_SEGMENT_NUM_MASK = 0x1ff;
00028 static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM = SI_SEGMENT_NUM_MASK;
00029
00030 struct syminfo {
00031 unsigned int symbol_num : 10;
00032 unsigned int segment_num : 9;
00033 unsigned int field_num : 1;
00034 unsigned int valid : 1;
00035 };
00036
00037
00038 static inline bool
00039 tag_is_start_field_sync (syminfo tag)
00040 {
00041 return tag.symbol_num == 0 && tag.segment_num == SI_FIELD_SYNC_SEGMENT_NUM && tag.valid;
00042 }
00043
00044 static inline bool
00045 tag_is_start_field_sync_1 (syminfo tag)
00046 {
00047 return tag_is_start_field_sync (tag) && tag.field_num == 0;
00048 }
00049
00050 static inline bool
00051 tag_is_start_field_sync_2 (syminfo tag)
00052 {
00053 return tag_is_start_field_sync (tag) && tag.field_num == 1;
00054 }
00055
00056 }
00057
00058 #endif