23 #ifndef INCLUDED_ATSC_RANDOMIZE_H
24 #define INCLUDED_ATSC_RANDOMIZE_H
50 unsigned int state()
const {
return d_state; }
52 static void initialize_output_map ();
53 static unsigned char slow_output_map (
int st);
55 static unsigned char fast_output_map (
int st){
56 return s_output_map[(st & 0xb23c) >> 2];
63 unsigned char output (){
64 return fast_output_map (d_state);
70 d_state = ((d_state ^ MASK) >> 1) | 0x8000;
72 d_state = d_state >> 1;
76 unsigned char output_and_clk (){
77 unsigned char r = output ();
84 static const unsigned int PRELOAD_VALUE = 0x018f;
85 static const unsigned int MASK = 0xa638;
86 static unsigned char s_output_map[1 << 14];
87 static bool s_output_map_initialized_p;
void reset()
reset randomizer LFSR
Definition: atsc_types.h:189
Definition: atsc_randomize.h:31
Definition: atsc_types.h:173
void randomize(atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet &in)
randomize (whiten) mpeg packet and remove leading MPEG-2 sync byte
void derandomize(atsc_mpeg_packet &out, const atsc_mpeg_packet_no_sync &in)
derandomize (de-whiten) mpeg packet and add leading MPEG-2 sync byte
unsigned int state() const
Definition: atsc_randomize.h:50