Changeset 8345

Show
Ignore:
Timestamp:
05/09/08 01:12:45
Author:
jcorgan
Message:

Applied changeset r8298 on trunk to release branch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gnuradio/branches/releases/3.1/gr-atsc/src/lib/atsc_depad.cc

    r6044 r8345  
    11/* -*- c++ -*- */ 
    22/* 
    3  * Copyright 2006 Free Software Foundation, Inc. 
     3 * Copyright 2006,2008 Free Software Foundation, Inc. 
    44 *  
    55 * This file is part of GNU Radio 
     
    2929#include <atsc_types.h> 
    3030 
    31 static const int INTR = ATSC_MPEG_PKT_LENGTH; 
    32  
    3331atsc_depad_sptr 
    3432atsc_make_depad() 
     
    3937atsc_depad::atsc_depad() 
    4038  : gr_sync_interpolator("atsc_depad", 
    41                 gr_make_io_signature(1, 1, sizeof(atsc_mpeg_packet)), 
    42                 gr_make_io_signature(1, 1, sizeof(unsigned char)), 
    43                   INTR
     39                        gr_make_io_signature(1, 1, sizeof(atsc_mpeg_packet)), 
     40                        gr_make_io_signature(1, 1, sizeof(unsigned char)), 
     41                        ATSC_MPEG_PKT_LENGTH
    4442{ 
    4543  reset(); 
    4644} 
    4745 
    48 void 
    49 atsc_depad::forecast (int noutput_items, gr_vector_int &ninput_items_required) 
    50 { 
    51   unsigned ninputs = ninput_items_required.size(); 
    52   for (unsigned i = 0; i < ninputs; i++)  
    53     ninput_items_required[i] = noutput_items / ATSC_MPEG_PKT_LENGTH; 
    54 } 
    55  
    56  
    5746int 
    5847atsc_depad::work (int noutput_items, 
    59                        gr_vector_const_void_star &input_items, 
    60                        gr_vector_void_star &output_items) 
     48                  gr_vector_const_void_star &input_items, 
     49                  gr_vector_void_star &output_items) 
    6150{ 
    6251  const atsc_mpeg_packet *in = (const atsc_mpeg_packet *) input_items[0]; 
    6352  unsigned char *out = (unsigned char *) output_items[0]; 
    6453 
    65   // size with padding (256) 
    66   unsigned int ATSC_MPEG_PKT = sizeof(atsc_mpeg_packet); 
    6754  unsigned int i; 
    6855 
    69   for (i = 0; i < noutput_items/ATSC_MPEG_PKT + 1; i++){ 
    70     for (int j = 0; j < ATSC_MPEG_PKT_LENGTH; j++) 
    71         out[i * ATSC_MPEG_PKT_LENGTH + j] = in[i * ATSC_MPEG_PKT].data[j]; 
    72  
     56  for (i = 0; i < noutput_items/ATSC_MPEG_PKT_LENGTH; i++){ 
     57    memcpy(&out[i * ATSC_MPEG_PKT_LENGTH], in[i].data, ATSC_MPEG_PKT_LENGTH); 
    7358  } 
    7459 
    7560  return i * ATSC_MPEG_PKT_LENGTH; 
    7661} 
    77  
    78  
    79  
    80  
  • gnuradio/branches/releases/3.1/gr-atsc/src/lib/atsc_depad.h

    r6044 r8345  
    3131 
    3232/*! 
    33  * \brief depad mpeg ts packets from 256 byte atsc_mpeg_packet 
    34  * to 188 byte char 
     33 * \brief depad mpeg ts packets from 256 byte atsc_mpeg_packet to 188 byte char 
    3534 * \ingroup atsc 
    3635 * 
     
    4443 
    4544public: 
    46   void forecast (int noutput_items, gr_vector_int &ninput_items_required); 
    4745  int work (int noutput_items, 
    4846            gr_vector_const_void_star &input_items,