Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-release > by-pkgid > 2a781e5f78e233aedaa1e51ed196dcc3 > files > 56

lib64zvbi-devel-0.2.35-5.mga6.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ZVBI Library: Raw VBI encoder</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ZVBI Library
   &#160;<span id="projectnumber">0.2.35</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Raw VBI encoder<div class="ingroups"><a class="el" href="group__Raw.html">Raw VBI</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Converting sliced VBI data to raw VBI images.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga885133bce06ae9f142bda5b9648e4d90"><td class="memItemLeft" align="right" valign="top">vbi_bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Rawenc.html#ga885133bce06ae9f142bda5b9648e4d90">vbi_raw_video_image</a> (uint8_t *raw, unsigned long raw_size, const vbi_sampling_par *sp, int blank_level, int black_level, int white_level, unsigned int pixel_mask, vbi_bool swap_fields, const <a class="el" href="structvbi__sliced.html">vbi_sliced</a> *sliced, unsigned int n_sliced_lines)</td></tr>
<tr class="separator:ga885133bce06ae9f142bda5b9648e4d90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa35da5ba0aed07e00e0f959ae22200e4"><td class="memItemLeft" align="right" valign="top">vbi_bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Rawenc.html#gaa35da5ba0aed07e00e0f959ae22200e4">vbi_raw_add_noise</a> (uint8_t *raw, const vbi_sampling_par *sp, unsigned int min_freq, unsigned int max_freq, unsigned int amplitude, unsigned int seed)</td></tr>
<tr class="separator:gaa35da5ba0aed07e00e0f959ae22200e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0a1c6b6a9712593cde228222dc66b258"><td class="memItemLeft" align="right" valign="top">vbi_bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Rawenc.html#ga0a1c6b6a9712593cde228222dc66b258">vbi_raw_vbi_image</a> (uint8_t *raw, unsigned long raw_size, const vbi_sampling_par *sp, int blank_level, int white_level, vbi_bool swap_fields, const <a class="el" href="structvbi__sliced.html">vbi_sliced</a> *sliced, unsigned int n_sliced_lines)</td></tr>
<tr class="separator:ga0a1c6b6a9712593cde228222dc66b258"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Converting sliced VBI data to raw VBI images. </p>
<p>These are functions converting sliced VBI data to raw VBI images as transmitted in the vertical blanking interval of analog video standards. They are mainly intended for tests of the libzvbi bit slicer and raw VBI decoder. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga885133bce06ae9f142bda5b9648e4d90"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vbi_bool vbi_raw_video_image </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>raw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>raw_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const vbi_sampling_par *&#160;</td>
          <td class="paramname"><em>sp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>blank_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>black_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>white_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pixel_mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vbi_bool&#160;</td>
          <td class="paramname"><em>swap_fields</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structvbi__sliced.html">vbi_sliced</a> *&#160;</td>
          <td class="paramname"><em>sliced</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>n_sliced_lines</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">raw</td><td>A raw VBI image will be stored here. </td></tr>
    <tr><td class="paramname">raw_size</td><td>Size of the <em>raw</em> buffer in bytes. The buffer must be large enough for <em>sp-&gt;count</em>[0] + count[1] lines of <em>sp-&gt;bytes_per_line</em> each, with <em>sp-&gt;samples_per_line</em> times bytes per pixel (in libzvbi 0.2.x <em>sp-&gt;bytes_per_line</em>) actually written. </td></tr>
    <tr><td class="paramname">sp</td><td>Describes the raw VBI data to generate. Note for compatibility in libzvbi 0.2.x vbi_sampling_par is a synonym of <a class="el" href="structvbi__raw__decoder.html" title="Raw vbi decoder context. ">vbi_raw_decoder</a>, but the (private) decoder fields in this structure are ignored. </td></tr>
    <tr><td class="paramname">blank_level</td><td>The level of the horizontal blanking in the raw VBI image. Must be &lt;= <em>black_level</em>. </td></tr>
    <tr><td class="paramname">black_level</td><td>The black level in the raw VBI image. Must be &lt;= <em>white_level</em>. </td></tr>
    <tr><td class="paramname">white_level</td><td>The peak white level in the raw VBI image. Set to zero to get the default blanking, black and white level. </td></tr>
    <tr><td class="paramname">pixel_mask</td><td>This mask selects which color or alpha channel shall contain VBI data. Depending on <em>sp-&gt;sampling_format</em> it is interpreted as 0xAABBGGRR or 0xAAVVUUYY. A value of 0x000000FF for example writes data in "red bits", not changing other bits in the <em>raw</em> buffer. When the <em>sp-&gt;sampling_format</em> is a planar YUV the function writes the Y plane only. </td></tr>
    <tr><td class="paramname">swap_fields</td><td>If <code>TRUE</code> the second field will be stored first in the <code>raw</code> buffer. Note you can also get an interlaced image by setting <em>sp-&gt;interlaced</em> to <code>TRUE</code>. <em>sp-&gt;synchronous</em> is ignored. </td></tr>
    <tr><td class="paramname">sliced</td><td>Pointer to an array of <a class="el" href="structvbi__sliced.html" title="This structure holds one scan line of sliced vbi data. ">vbi_sliced</a> containing the VBI data to be encoded. </td></tr>
    <tr><td class="paramname">n_sliced_lines</td><td>Number of elements in the <em>sliced</em> array.</td></tr>
  </table>
  </dd>
</dl>
<p>Generates a raw VBI image similar to those you get from video capture hardware. Otherwise identical to <a class="el" href="group__Rawenc.html#ga0a1c6b6a9712593cde228222dc66b258">vbi_raw_vbi_image()</a>.</p>
<dl class="section return"><dt>Returns</dt><dd><code>FALSE</code> if the <em>raw_size</em> is too small, if the <em>sp</em> sampling parameters are invalid, if the signal levels are invalid, if the <em>sliced</em> array contains unsupported services or line numbers outside the <em>sp</em> sampling parameters.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>0.2.22 </dd></dl>

</div>
</div>
<a class="anchor" id="gaa35da5ba0aed07e00e0f959ae22200e4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vbi_bool vbi_raw_add_noise </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>raw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const vbi_sampling_par *&#160;</td>
          <td class="paramname"><em>sp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>min_freq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>max_freq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>amplitude</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>seed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">raw</td><td>Noise will be added to this raw VBI image. </td></tr>
    <tr><td class="paramname">sp</td><td>Describes the raw VBI data in the buffer. <em>sp-&gt;sampling_format</em> must be <code>VBI_PIXFMT_Y8</code> (<code>VBI_PIXFMT_YUV420</code> in libzvbi 0.2.x). Note for compatibility in libzvbi 0.2.x vbi_sampling_par is a synonym of <a class="el" href="structvbi__raw__decoder.html" title="Raw vbi decoder context. ">vbi_raw_decoder</a>, but the (private) decoder fields in this structure are ignored. </td></tr>
    <tr><td class="paramname">min_freq</td><td>Minimum frequency of the noise in Hz. </td></tr>
    <tr><td class="paramname">max_freq</td><td>Maximum frequency of the noise in Hz. <em>min_freq</em> and <em>max_freq</em> define the cut off frequency at the half power points (gain -3 dB). </td></tr>
    <tr><td class="paramname">amplitude</td><td>Maximum amplitude of the noise, should lie in range 0 to 256. </td></tr>
    <tr><td class="paramname">seed</td><td>Seed for the pseudo random number generator built into this function. Given the same <em>seed</em> value the function will add the same noise, which can be useful for tests.</td></tr>
  </table>
  </dd>
</dl>
<p>This function adds white noise to a raw VBI image.</p>
<p>To produce realistic noise <em>min_freq</em> = 0, <em>max_freq</em> = 5e6 and <em>amplitude</em> = 20 to 50 seems appropriate.</p>
<dl class="section return"><dt>Returns</dt><dd>FALSE if the <em>sp</em> sampling parameters are invalid.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>0.2.26 </dd></dl>

<p>References <a class="el" href="structvbi__sliced.html#add8a7578942158880b5e3472adcd5eed">vbi_sliced::id</a>, <a class="el" href="structvbi__sliced.html#a72fee7fa9e5be3767e0dbd91f68d4633">vbi_sliced::line</a>, and <a class="el" href="group__Sliced.html#ga3cf9e7694a3f3c1cc77be844b63d8789">vbi_sliced_name()</a>.</p>

<p>Referenced by <a class="el" href="group__Device.html#ga70fb48f27dedf650a3cba0d7470fd47e">vbi_capture_sim_decode_raw()</a>.</p>

</div>
</div>
<a class="anchor" id="ga0a1c6b6a9712593cde228222dc66b258"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vbi_bool vbi_raw_vbi_image </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>raw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>raw_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const vbi_sampling_par *&#160;</td>
          <td class="paramname"><em>sp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>blank_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>white_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vbi_bool&#160;</td>
          <td class="paramname"><em>swap_fields</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structvbi__sliced.html">vbi_sliced</a> *&#160;</td>
          <td class="paramname"><em>sliced</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>n_sliced_lines</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">raw</td><td>A raw VBI image will be stored here. </td></tr>
    <tr><td class="paramname">raw_size</td><td>Size of the <em>raw</em> buffer in bytes. The buffer must be large enough for <em>sp-&gt;count</em>[0] + count[1] lines of <em>sp-&gt;bytes_per_line</em> each, with <em>sp-&gt;samples_per_line</em> (in libzvbi 0.2.x <em>sp-&gt;bytes_per_line</em>) bytes actually written. </td></tr>
    <tr><td class="paramname">sp</td><td>Describes the raw VBI data to generate. <em>sp-&gt;sampling_format</em> must be <code>VBI_PIXFMT_Y8</code> (<code>VBI_PIXFMT_YUV420</code> with libzvbi 0.2.x). <em>sp-&gt;synchronous</em> is ignored. Note for compatibility in libzvbi 0.2.x vbi_sampling_par is a synonym of <a class="el" href="structvbi__raw__decoder.html" title="Raw vbi decoder context. ">vbi_raw_decoder</a>, but the (private) decoder fields in this structure are ignored. </td></tr>
    <tr><td class="paramname">blank_level</td><td>The level of the horizontal blanking in the raw VBI image. Must be &lt;= <em>white_level</em>. </td></tr>
    <tr><td class="paramname">white_level</td><td>The peak white level in the raw VBI image. Set to zero to get the default blanking and white level. </td></tr>
    <tr><td class="paramname">swap_fields</td><td>If <code>TRUE</code> the second field will be stored first in the <code>raw</code> buffer. Note you can also get an interlaced image by setting <em>sp-&gt;interlaced</em> to <code>TRUE</code>. <em>sp-&gt;synchronous</em> is ignored. </td></tr>
    <tr><td class="paramname">sliced</td><td>Pointer to an array of <a class="el" href="structvbi__sliced.html" title="This structure holds one scan line of sliced vbi data. ">vbi_sliced</a> containing the VBI data to be encoded. </td></tr>
    <tr><td class="paramname">n_sliced_lines</td><td>Number of elements in the <em>sliced</em> array.</td></tr>
  </table>
  </dd>
</dl>
<p>This function basically reverses the operation of the <a class="el" href="structvbi__raw__decoder.html" title="Raw vbi decoder context. ">vbi_raw_decoder</a>, taking sliced VBI data and generating a raw VBI image similar to those you would get from raw VBI sampling hardware. The following data services are currently supported: All Teletext services, VPS, WSS 625, Closed Caption 525 and 625.</p>
<p>The function encodes sliced data as is, e.g. without adding or checking parity bits, without checking if the line number is correct for the respective data service, or if the signal will fit completely in the given space (<em>sp-&gt;offset</em> and <em>sp-&gt;samples_per_line</em> at <em>sp-&gt;sampling_rate</em>).</p>
<p>Apart of the payload the generated video signal is invariable and attempts to be faithful to related standards. You can only change the characteristics of the assumed capture device. Sync pulses and color bursts and not generated if the sampling parameters extend to this area.</p>
<dl class="section note"><dt>Note</dt><dd>This function is mainly intended for testing purposes. It is optimized for accuracy, not for speed.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code>FALSE</code> if the <em>raw_size</em> is too small, if the <em>sp</em> sampling parameters are invalid, if the signal levels are invalid, if the <em>sliced</em> array contains unsupported services or line numbers outside the <em>sp</em> sampling parameters.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>0.2.22 </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>