Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

atsc_randomizer Class Reference

ATSC data "whitener". More...

#include <atsc_randomizer.h>

List of all members.

Public Member Functions

 atsc_randomizer ()
void reset ()
 reset randomizer LFSR
void randomize (atsc_mpeg_packet_no_sync &out, atsc_mpeg_packet &in)
 randomize (whiten) mpeg packet and remove leading MPEG-2 sync byte
void derandomize (atsc_mpeg_packet &out, atsc_mpeg_packet_no_sync &in)
 derandomize (de-whiten) mpeg packet and add leading MPEG-2 sync byte

Private Member Functions

unsigned char output ()
 return current output value
void clk ()
 clock LFSR; advance to next state.
unsigned char output_and_clk ()
 return current output value and advance to next state

Static Private Member Functions

void initialize_output_map ()
 Generate the table used in the fast_output_map function.
unsigned char slow_output_map (int st)
unsigned char fast_output_map (int st)

Private Attributes

unsigned int state

Static Private Attributes

const unsigned int preload_value = 0x018f
const unsigned int mask = 0xa638
unsigned char output_map [1<< 14]
bool output_map_initialized_p = false


Detailed Description

ATSC data "whitener".

The data randomizer described in ATSC standard A/53B. See figure D4 on page 54.


Constructor & Destructor Documentation

atsc_randomizer::atsc_randomizer  ) 
 


Member Function Documentation

void atsc_randomizer::clk  )  [inline, private]
 

clock LFSR; advance to next state.

void atsc_randomizer::derandomize atsc_mpeg_packet out,
atsc_mpeg_packet_no_sync in
 

derandomize (de-whiten) mpeg packet and add leading MPEG-2 sync byte

unsigned char atsc_randomizer::fast_output_map int  st  )  [inline, static, private]
 

void atsc_randomizer::initialize_output_map  )  [static, private]
 

Generate the table used in the fast_output_map function.

The table has 16K byte entries, but because of how is is used, only 256 entries end up being resident in the cache. This seems like a good use of memory. We can get away with a 16K table because the low two bits of the state do not affect the output function. By shifting right those two bits we shrink the table, and also get better cache line utilization.

unsigned char atsc_randomizer::output  )  [inline, private]
 

return current output value

unsigned char atsc_randomizer::output_and_clk  )  [inline, private]
 

return current output value and advance to next state

void atsc_randomizer::randomize atsc_mpeg_packet_no_sync out,
atsc_mpeg_packet in
 

randomize (whiten) mpeg packet and remove leading MPEG-2 sync byte

void atsc_randomizer::reset  ) 
 

reset randomizer LFSR

must be called during the Data Segment Sync interval prior to the first data segment. I.e., the LFSR is reset prior to the first field of each VSB data frame.

unsigned char atsc_randomizer::slow_output_map int  st  )  [static, private]
 


Member Data Documentation

const unsigned int atsc_randomizer::mask = 0xa638 [static, private]
 

unsigned char atsc_randomizer::output_map [static, private]
 

bool atsc_randomizer::output_map_initialized_p = false [static, private]
 

const unsigned int atsc_randomizer::preload_value = 0x018f [static, private]
 

unsigned int atsc_randomizer::state [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Aug 4 02:22:09 2004 for GNU Radio by doxygen 1.3.8