From 3d38e82e7d87dfc01132b199e33b53add8a706fa Mon Sep 17 00:00:00 2001
From: Tom Rondeau <trondeau@vt.edu>
Date: Fri, 15 Mar 2013 20:49:05 -0400
Subject: atsc: adjustments to atsc to start to conform to v3.7 structure.

Not going to comply completely with the new structure; just wanted to get it so that it looked more consistent once installed.
---
 gr-atsc/include/atsc/viterbi_decoder_impl.h | 84 +++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 gr-atsc/include/atsc/viterbi_decoder_impl.h

(limited to 'gr-atsc/include/atsc/viterbi_decoder_impl.h')

diff --git a/gr-atsc/include/atsc/viterbi_decoder_impl.h b/gr-atsc/include/atsc/viterbi_decoder_impl.h
new file mode 100644
index 0000000000..307b157a9b
--- /dev/null
+++ b/gr-atsc/include/atsc/viterbi_decoder_impl.h
@@ -0,0 +1,84 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2002 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _ATSC_VITERBI_DECODER_H_
+#define _ATSC_VITERBI_DECODER_H_
+
+#define	USE_SIMPLE_SLICER  0
+
+#include <atsc/api.h>
+#include <atsc/types.h>
+#include <atsc/interleaver_fifo.h>
+
+#if (USE_SIMPLE_SLICER)
+#include <atsc/fake_single_viterbi_impl.h>
+typedef atsci_fake_single_viterbi	single_viterbi_t;
+#else
+#include <atsc/single_viterbi_impl.h>
+typedef atsci_single_viterbi		single_viterbi_t;
+#endif
+
+/*!
+ * \brief fancy, schmancy 12-way interleaved viterbi decoder for ATSC
+ */
+
+class ATSC_API atsci_viterbi_decoder {
+public:
+  static const int	NCODERS = 12;
+
+  atsci_viterbi_decoder ();
+  ~atsci_viterbi_decoder ();
+
+  //! reset all decoder states
+  void reset ();
+
+  /*!
+   * Take 12 data segments of soft decisions (floats) and
+   * produce 12 RS encoded data segments.  We work in groups of 12
+   * because that's the smallest number of segments that composes a
+   * single full cycle of the decoder mux.
+   */
+  void decode (atsc_mpeg_packet_rs_encoded out[NCODERS],
+	       const atsc_soft_data_segment in[NCODERS]);
+
+
+
+ protected:
+  typedef interleaver_fifo<unsigned char>	fifo_t;
+
+  static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH;	// 207
+  static const int OUTPUT_SIZE = (SEGMENT_SIZE * 12);
+  static const int INPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12);
+
+  void decode_helper (unsigned char out[OUTPUT_SIZE],
+		      const float in[INPUT_SIZE]);
+
+
+  single_viterbi_t	viterbi[NCODERS];
+  fifo_t		*fifo[NCODERS];
+  bool			debug;
+
+};
+
+
+
+#endif /* _ATSC_VITERBI_DECODER_H_ */
-- 
cgit v1.2.3