Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > main-release > by-pkgid > 1af184c486f5d5f476d50602700ee0a0 > files > 46

lib64zvbi-devel-0.2.33-2mdv2010.0.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ZVBI Library: Raw VBI encoder</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Raw VBI encoder<br>
<small>
[<a class="el" href="group__Raw.html">Raw VBI</a>]</small>
</h1>Converting sliced VBI data to raw VBI images.  
<a href="#_details">More...</a>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">vbi_bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Rawenc.html#g885133bce06ae9f142bda5b9648e4d90">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><td class="memItemLeft" nowrap align="right" valign="top">vbi_bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Rawenc.html#ga35da5ba0aed07e00e0f959ae22200e4">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><td class="memItemLeft" nowrap align="right" valign="top">vbi_bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Rawenc.html#g0a1c6b6a9712593cde228222dc66b258">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>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Converting sliced VBI data to raw VBI images. 
<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. <hr><h2>Function Documentation</h2>
<a class="anchor" name="g885133bce06ae9f142bda5b9648e4d90"></a><!-- doxytag: member="io&#45;sim.h::vbi_raw_video_image" ref="g885133bce06ae9f142bda5b9648e4d90" args="(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 vbi_sliced *sliced, unsigned int n_sliced_lines)" -->
<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 *&nbsp;</td>
          <td class="paramname"> <em>raw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&nbsp;</td>
          <td class="paramname"> <em>raw_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const vbi_sampling_par *&nbsp;</td>
          <td class="paramname"> <em>sp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>blank_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>black_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>white_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>pixel_mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vbi_bool&nbsp;</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> *&nbsp;</td>
          <td class="paramname"> <em>sliced</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>n_sliced_lines</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>raw</em>&nbsp;</td><td>A raw VBI image will be stored here. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>raw_size</em>&nbsp;</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 valign="top"></td><td valign="top"><em>sp</em>&nbsp;</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 valign="top"></td><td valign="top"><em>blank_level</em>&nbsp;</td><td>The level of the horizontal blanking in the raw VBI image. Must be &lt;= <em>black_level</em>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>black_level</em>&nbsp;</td><td>The black level in the raw VBI image. Must be &lt;= <em>white_level</em>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>white_level</em>&nbsp;</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 valign="top"></td><td valign="top"><em>pixel_mask</em>&nbsp;</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 valign="top"></td><td valign="top"><em>swap_fields</em>&nbsp;</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 valign="top"></td><td valign="top"><em>sliced</em>&nbsp;</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 valign="top"></td><td valign="top"><em>n_sliced_lines</em>&nbsp;</td><td>Number of elements in the <em>sliced</em> array.</td></tr>
  </table>
</dl>
Generates a raw VBI image similar to those you get from video capture hardware. Otherwise identical to <a class="el" href="group__Rawenc.html#g0a1c6b6a9712593cde228222dc66b258">vbi_raw_vbi_image()</a>.<p>
<dl class="return" compact><dt><b>Returns:</b></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="since" compact><dt><b>Since:</b></dt><dd>0.2.22 </dd></dl>

</div>
</div><p>
<a class="anchor" name="ga35da5ba0aed07e00e0f959ae22200e4"></a><!-- doxytag: member="io&#45;sim.h::vbi_raw_add_noise" ref="ga35da5ba0aed07e00e0f959ae22200e4" args="(uint8_t *raw, const vbi_sampling_par *sp, unsigned int min_freq, unsigned int max_freq, unsigned int amplitude, unsigned int seed)" -->
<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 *&nbsp;</td>
          <td class="paramname"> <em>raw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const vbi_sampling_par *&nbsp;</td>
          <td class="paramname"> <em>sp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>min_freq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>max_freq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>amplitude</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>seed</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>raw</em>&nbsp;</td><td>Noise will be added to this raw VBI image. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sp</em>&nbsp;</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 valign="top"></td><td valign="top"><em>min_freq</em>&nbsp;</td><td>Minimum frequency of the noise in Hz. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>max_freq</em>&nbsp;</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 valign="top"></td><td valign="top"><em>amplitude</em>&nbsp;</td><td>Maximum amplitude of the noise, should lie in range 0 to 256. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>seed</em>&nbsp;</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>
</dl>
This function adds white noise to a raw VBI image.<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="return" compact><dt><b>Returns:</b></dt><dd>FALSE if the <em>sp</em> sampling parameters are invalid.</dd></dl>
<dl class="since" compact><dt><b>Since:</b></dt><dd>0.2.26 </dd></dl>

</div>
</div><p>
<a class="anchor" name="g0a1c6b6a9712593cde228222dc66b258"></a><!-- doxytag: member="io&#45;sim.h::vbi_raw_vbi_image" ref="g0a1c6b6a9712593cde228222dc66b258" args="(uint8_t *raw, unsigned long raw_size, const vbi_sampling_par *sp, int blank_level, int white_level, vbi_bool swap_fields, const vbi_sliced *sliced, unsigned int n_sliced_lines)" -->
<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 *&nbsp;</td>
          <td class="paramname"> <em>raw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&nbsp;</td>
          <td class="paramname"> <em>raw_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const vbi_sampling_par *&nbsp;</td>
          <td class="paramname"> <em>sp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>blank_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>white_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vbi_bool&nbsp;</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> *&nbsp;</td>
          <td class="paramname"> <em>sliced</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>n_sliced_lines</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>raw</em>&nbsp;</td><td>A raw VBI image will be stored here. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>raw_size</em>&nbsp;</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 valign="top"></td><td valign="top"><em>sp</em>&nbsp;</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 valign="top"></td><td valign="top"><em>blank_level</em>&nbsp;</td><td>The level of the horizontal blanking in the raw VBI image. Must be &lt;= <em>white_level</em>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>white_level</em>&nbsp;</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 valign="top"></td><td valign="top"><em>swap_fields</em>&nbsp;</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 valign="top"></td><td valign="top"><em>sliced</em>&nbsp;</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 valign="top"></td><td valign="top"><em>n_sliced_lines</em>&nbsp;</td><td>Number of elements in the <em>sliced</em> array.</td></tr>
  </table>
</dl>
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>
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>
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="note" compact><dt><b>Note:</b></dt><dd>This function is mainly intended for testing purposes. It is optimized for accuracy, not for speed.</dd></dl>
<dl class="return" compact><dt><b>Returns:</b></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="since" compact><dt><b>Since:</b></dt><dd>0.2.22 </dd></dl>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed May 27 04:47:58 2009 for ZVBI Library by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>